mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Merge e651782221 into 19eaeb424f
This commit is contained in:
commit
32aca3abb4
1 changed files with 2 additions and 2 deletions
|
|
@ -4,7 +4,7 @@ local create_source_node = graph.create_source_node
|
||||||
local push_scope_as_child_of = graph.push_scope_as_child_of
|
local push_scope_as_child_of = graph.push_scope_as_child_of
|
||||||
local update_descendants = graph.update_descendants
|
local update_descendants = graph.update_descendants
|
||||||
|
|
||||||
export type Source<T> = (() -> T) & ((value: T) -> T)
|
export type Source<T> = (() -> T) & (<U>(value: U & T) -> U & T)
|
||||||
|
|
||||||
local function source<T>(initial_value: T): Source<T>
|
local function source<T>(initial_value: T): Source<T>
|
||||||
local node = create_source_node(initial_value)
|
local node = create_source_node(initial_value)
|
||||||
|
|
@ -25,7 +25,7 @@ local function source<T>(initial_value: T): Source<T>
|
||||||
return v
|
return v
|
||||||
end
|
end
|
||||||
|
|
||||||
return update_source
|
return update_source :: Source<T>
|
||||||
end
|
end
|
||||||
|
|
||||||
return source :: (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
return source :: (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue