mirror of
https://github.com/littensy/charm.git
synced 2026-10-21 03:36:11 +00:00
refactor!: rename derive, map
This commit is contained in:
parent
f2f7a16599
commit
b715b81fec
18 changed files with 163 additions and 133 deletions
|
|
@ -4,7 +4,7 @@
|
|||
local Package = game:GetService("ReplicatedStorage").Packages.charm
|
||||
|
||||
local atom = require(Package.atom)
|
||||
local derive = require(Package.derive)
|
||||
local computed = require(Package.computed)
|
||||
|
||||
local function parameterGenerator()
|
||||
return atom({ count = 0 })
|
||||
|
|
@ -17,8 +17,8 @@ local benchmarks = {
|
|||
end
|
||||
end,
|
||||
|
||||
derived = function(_, source: any)
|
||||
derive(function()
|
||||
computed = function(_, source: any)
|
||||
computed(function()
|
||||
return { count = 2 * source().count }
|
||||
end)
|
||||
for _ = 1, 500 do
|
||||
|
|
@ -26,11 +26,11 @@ local benchmarks = {
|
|||
end
|
||||
end,
|
||||
|
||||
derived_nested = function(_, source: any)
|
||||
local double = derive(function()
|
||||
computed_nested = function(_, source: any)
|
||||
local double = computed(function()
|
||||
return { count = 2 * source().count }
|
||||
end)
|
||||
derive(function()
|
||||
computed(function()
|
||||
return { count = 2 * double().count }
|
||||
end)
|
||||
for _ = 1, 500 do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue