signalDependencies (Function)
Signature: signalDependencies(work: () -> t0) -> List<string>
Description: Returns the checked static signal operations a callback may read, without invoking it. An unresolved remainder is <unknown>.
Parameters
- work (
() -> t0): A zero-argument computation
Returns: List<string>
Example
static effect Signal<T> { read: fn() -> T }
type Count = { value: int }
fn readCount() = (perform Signal<Count>.read()).value
fn counterLabel() = "count=${readCount()}"
let cached = {
handle static Signal<Count> { read => Count { value: 1 } }
signalSnapshot(counterLabel)
}
let updated = {
handle static Signal<Count> { read => Count { value: 2 } }
signalRefresh(cached, signalDependencies(readCount), counterLabel)
}
print("${updated.value}; revision=${updated.revision}; ${join(signalDependencies(counterLabel), ",")}")
static effect Signal T
read : Unit => T
type Count =
value : int
readCount () = (perform Signal<Count>.read ()).value
counterLabel () = "count=${readCount ()}"
cached =
handle static Signal<Count>
read => Count(value = 1)
signalSnapshot counterLabel
updated =
handle static Signal<Count>
read => Count(value = 2)
signalRefresh (cached, signalDependencies readCount, counterLabel)
print "${updated.value}; revision=${updated.revision}; ${join (signalDependencies counterLabel, ",")}"