Returns the continuous version of this signal, which emits the
current A
value on each request for an element from the stream.
Returns the continuous version of this signal, which emits the
current A
value on each request for an element from the stream.
Note that this may not see all changes of A
as it
always gets the current A
at each request for an element.
Returns the discrete version of this signal, updated only when the value is changed.
Returns the discrete version of this signal, updated only when the value is changed.
The value _may_ change several times between reads, but it is guaranteed the latest value will be emitted after a series of changes.
If you want to be notified about every single change, use async.queue
for signalling.
Asynchronously gets the current value of this Signal
.
Asynchronously gets the current value of this Signal
.
Like update but allows the update function to return an output value of type B
Asynchronously refreshes the value of the signal,
keeping the value of this Signal
the same, but notifing any listeners.
Sets the value of this Signal
.
Updates the current value using the supplied update function.
Updates the current value using the supplied update function. If another modification
occurs between the time the current value is read and subsequently updated, the modification
is retried using the new value. Hence, f
may be invoked multiple times.
Satisfies:
r.modify(_ => a) == r.set(a)
Returns an alternate view of this Signal
where its elements are of type B
,
given two functions, A => B
and B => A
.
Data type of a single value of type
A
that can be read and written in the effectF
.