refactor!: rename derive, map

This commit is contained in:
Richard 2024-05-26 21:31:28 -07:00
parent f2f7a16599
commit b715b81fec
18 changed files with 163 additions and 133 deletions

View file

@ -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