mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Fix source type
This commit is contained in:
parent
e1751fb8d0
commit
79d3a86004
1 changed files with 2 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ local update_descendants = graph.update_descendants
|
||||||
|
|
||||||
export type Source<T> = (() -> T) & ((value: T) -> T)
|
export type Source<T> = (() -> T) & ((value: T) -> 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)
|
||||||
|
|
||||||
return function(...): T
|
return function(...): T
|
||||||
|
|
@ -28,4 +28,4 @@ local function source<T>(initial_value: T): Source<T>
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return source :: (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
return source
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue