Initial commit

This commit is contained in:
aaron 2023-08-08 21:33:11 +01:00
commit cb002f4f27
50 changed files with 4666 additions and 0 deletions

16
src/derive.luau Normal file
View file

@ -0,0 +1,16 @@
if not game then script = (require :: any) "test/wrap-require" end
local graph = require(script.Parent.graph)
local create = graph.create
local get = graph.get
local capture_and_link = graph.capture_and_link
local function derive<T>(fn: () -> T): () -> T
local node, node_get = create((nil :: any) :: T)
node.cache = capture_and_link(node, fn)
return node_get
end
return derive