This commit is contained in:
Aaron Smith 2023-09-11 17:41:05 +01:00
parent dcc40b4dc1
commit 52ea2e4690
9 changed files with 147 additions and 102 deletions

View file

@ -2,8 +2,7 @@ if not game then script = require "test/relative-string" end
local graph = require(script.Parent.graph)
local create_node = graph.create_node
local add_child = graph.add_child
local update = graph.update
local set_owner = graph.set_owner
local track = graph.track
local get_scope = graph.get_scope
local open_scope = graph.open_scope
@ -15,11 +14,10 @@ local function derive<T>(fn: () -> T): () -> T
local node = create_node((false :: any) :: T)
node.effect = function()
node.cache = fn()
return fn()
end
add_child(owner, node)
set_owner(node, owner)
open_scope(node)
node.cache = fn()