mirror of
https://github.com/centau/vide.git
synced 2026-08-20 14:41:37 +00:00
Revert "Echo initial value if given a source"
This reverts commit 16e2983c54758cabfb1ddd102090f20083820d03.
This commit is contained in:
parent
6b465280eb
commit
fecce96a9f
2 changed files with 1 additions and 11 deletions
|
|
@ -9,10 +9,6 @@ local update = graph.update
|
|||
export type Source<T> = (() -> T) & ((T) -> T)
|
||||
|
||||
local function source<T>(initial_value: T): Source<T>
|
||||
if type(initial_value) == "function" then
|
||||
return initial_value
|
||||
end
|
||||
|
||||
local node = create_start_node(initial_value)
|
||||
|
||||
return function(...): T
|
||||
|
|
@ -32,4 +28,4 @@ local function source<T>(initial_value: T): Source<T>
|
|||
end
|
||||
end
|
||||
|
||||
return source :: (<T>(source: Source<T>) -> Source<T>) & (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
||||
return source :: (<T>(initial_value: T) -> Source<T>) & (<T>() -> Source<T>)
|
||||
|
|
|
|||
|
|
@ -359,12 +359,6 @@ TEST("source()", wrap_root(function()
|
|||
CHECK(src() == 2)
|
||||
end
|
||||
|
||||
do CASE "echo if value is a source"
|
||||
local a = source(1)
|
||||
local b = source(a)
|
||||
CHECK(a == b)
|
||||
end
|
||||
|
||||
do CASE "does not update if same value"
|
||||
local src = source(1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue