Fix source type

This commit is contained in:
Ketasaja 2024-08-06 23:09:26 +00:00
parent e1751fb8d0
commit 79d3a86004
No known key found for this signature in database
GPG key ID: CFEC764C3F7ADC69

View file

@ -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