mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
This commit is contained in:
parent
0e439f084f
commit
fe3af737be
11 changed files with 249 additions and 79 deletions
|
|
@ -3,12 +3,18 @@ if not game then script = require "test/relative-string" end
|
|||
local graph = require(script.Parent.graph)
|
||||
local create = graph.create
|
||||
local capture_and_link = graph.capture_and_link
|
||||
local create_and_open_scope = graph.create_and_open_scope
|
||||
local close_scope = graph.close_scope
|
||||
|
||||
local function derive<T>(fn: () -> T): () -> T
|
||||
local node, read_node_value = create((false :: any) :: T)
|
||||
|
||||
create_and_open_scope(node)
|
||||
|
||||
node.cache = capture_and_link(node, fn)
|
||||
|
||||
close_scope()
|
||||
|
||||
return read_node_value
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue