This commit is contained in:
Aaron Smith 2023-09-11 18:20:21 +01:00
parent 52ea2e4690
commit 5b61a9df10
13 changed files with 57 additions and 39 deletions

View file

@ -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)