mirror of
https://github.com/centau/vide.git
synced 2026-08-20 23:01:37 +00:00
Try improve error reporting
This commit is contained in:
parent
3b22f6ccf9
commit
58a31a1b32
16 changed files with 164 additions and 55 deletions
|
|
@ -9,7 +9,7 @@ export type Source<T> = (() -> T) & ((value: T) -> T)
|
|||
local function source<T>(initial_value: T): Source<T>
|
||||
local node = create_source_node(initial_value)
|
||||
|
||||
return function(...): T
|
||||
local function update_source(...): T
|
||||
if select("#", ...) == 0 then -- no args were given
|
||||
push_child_to_scope(node)
|
||||
return node.cache
|
||||
|
|
@ -24,6 +24,8 @@ local function source<T>(initial_value: T): Source<T>
|
|||
update_descendants(node)
|
||||
return v
|
||||
end
|
||||
|
||||
return update_source
|
||||
end
|
||||
|
||||
return source :: (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue