mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
This commit is contained in:
parent
bdd725659e
commit
d77fe0f92f
34 changed files with 1215 additions and 566 deletions
|
|
@ -8,13 +8,13 @@ local track = graph.track
|
|||
local get_scope = graph.get_scope
|
||||
local evaluate_node = graph.evaluate_node
|
||||
|
||||
local function derive<T>(fn: () -> T): () -> T
|
||||
local function derive<T>(source: () -> T): () -> T
|
||||
local owner = get_scope()
|
||||
if not owner then
|
||||
throw("cannot derive in non-reactive scope")
|
||||
end; assert(owner)
|
||||
|
||||
local node = create_node(false :: any, fn)
|
||||
local node = create_node(false :: any, source)
|
||||
|
||||
set_owner(node, owner)
|
||||
evaluate_node(node)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue