mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
This commit is contained in:
parent
dcc40b4dc1
commit
52ea2e4690
9 changed files with 147 additions and 102 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue