mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
Refactor codebase
This commit is contained in:
parent
07ae542e28
commit
a3f03fd067
15 changed files with 228 additions and 128 deletions
|
|
@ -5,11 +5,11 @@ local create = graph.create
|
|||
local capture_and_link = graph.capture_and_link
|
||||
|
||||
local function derive<T>(fn: () -> T): () -> T
|
||||
local node, node_get = create((nil :: any) :: T)
|
||||
local node, read_node_value = create((false :: any) :: T)
|
||||
|
||||
node.cache = capture_and_link(node, fn)
|
||||
|
||||
return node_get
|
||||
return read_node_value
|
||||
end
|
||||
|
||||
return derive
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue