mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
This commit is contained in:
parent
52ea2e4690
commit
5b61a9df10
13 changed files with 57 additions and 39 deletions
|
|
@ -1,5 +1,6 @@
|
|||
if not game then script = require "test/relative-string" end
|
||||
|
||||
local throw = require(script.Parent.throw)
|
||||
local graph = require(script.Parent.graph)
|
||||
local create_node = graph.create_node
|
||||
local set_owner = graph.set_owner
|
||||
|
|
@ -8,8 +9,10 @@ local get_scope = graph.get_scope
|
|||
local open_scope = graph.open_scope
|
||||
local close_scope = graph.close_scope
|
||||
|
||||
|
||||
local function derive<T>(fn: () -> 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) :: T)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue