Downcasts this reactive into a signal.
Downcasts this reactive into a signal.
Throws an exception if the current reactive is not a signal.
the signal version of the current reactive
If the current reactive is a signal already this method downcasts it,
otherwise it lifts it into a signal with the initial value init
.
If the current reactive is a signal already this method downcasts it,
otherwise it lifts it into a signal with the initial value init
.
optional value to use when converting the reactive to a signal
the signal version of the current reactive
Concatenates the events produced by all the reactives emitted by this
.
Concatenates the events produced by all the reactives emitted by this
.
This operation is only available for reactive values that emit
other reactives as events.
Once this
and all the reactives unreact, this reactive unreacts.
Use case:
def concat[S](): Reactive[S]
the type of the events in reactives emitted by this
evidence that events of type T
produced by this
are
actually reactive values of type S
evidence that arrays can be created for type S
evidence that buffering events is allowed
a subscription and the reactive that concatenates all the events
This operation potentially buffers events from the nested reactives.
Unless each reactive emitted by this
is known to unreact eventually,
this operation should not be called.
To enforce this, clients are required to import the CanBeBuffered
evidence
explicitly into the scope in which they call concat
.
Creates a concatenation of this
and that
reactive.
Creates a concatenation of this
and that
reactive.
The resulting reactive value produces all the events from this
reactive
until this
unreacts, and then outputs all the events from that
that happened before and after this
unreacted.
To do this, this operation potentially caches all the events from that
.
When that
unreacts, the resulting reactive value unreacts.
Use case:
def concat(that: Reactive[T]): Reactive[T]
another reactive value for the concatenation
evidence that arrays can be created for the type T
evidence that the client allows events from that
to be buffered
a subscription and a reactive value that concatenates events from this
and that
This operation potentially caches events from that
.
Unless certain that this
eventually unreacts, concat
should not be used.
To enforce this, clients must import the CanBeBuffered
evidence explicitly
into the scope in which they call concat
.
Given an initial event init
, converts this reactive into a Signal
.
Given an initial event init
, converts this reactive into a Signal
.
The resulting signal initially contains the event init
,
and subsequently any event that the this
reactive produces.
an initial value for the signal
the signal version of the current reactive
Syncs the arrival of events from this
and that
reactive value.
Syncs the arrival of events from this
and that
reactive value.
Ensures that pairs of events from this reactive value and that reactive value
are emitted together.
If the events produced in time by this
and that
, the sync will be as follows:
time ---------------------------> this ----1---------2-------4----> that --1-----2--3---------------> sync ----1,1-------2,2-----4,3-->
Pairs of events produced from this
and that
are then transformed using
specified function f
.
For example, clients that want to output tuples do:
val synced = (a sync b) { (a, b) => (a, b) }
Clients that, for example, want to create differences in pairs of events do:
val diffs = (a sync b)(_ - _)
The resulting reactive unreacts either when
this
unreacts and there are no more buffered events from this,
or when that
unreacts and there are no more buffered events from that
.
Use case:
def sync[S, R](that: Reactive[S])(f: (T, S) => R): Reactive[R]
the type of the events in that
reactive
the type of the events in the resulting reactive
the reactive to sync with
the mapping function for the pair of events
evidence that arrays can be created for the type T
evidence that arrays can be created for the type S
evidence that the client allows events to be buffered
a subscription and the reactive with the resulting events
This operation potentially caches events from this
and that
.
Unless certain that both this
produces a bounded number of events
before the that
produces an event, and vice versa, this operation should not be called.
To enforce this, clients must import the CanBeBuffered
evidence explicitly
into the scope in which they call sync
.
Unifies the events produced by all the reactives emitted by this
.
Unifies the events produced by all the reactives emitted by this
.
This operation is only available for reactive values that emit
other reactives as events.
The resulting reactive unifies events of all the reactives emitted by this
.
Once this
and all the reactives emitted by this
unreact, the resulting reactive terminates.
Example:
time --------------------------> this --1----2--------3------> ---------5----6----> ---4----------7--> union -----1----2-4---5--3-6-7-->
Use case:
def union[S](): Reactive[S]
the type of the events in reactives emitted by this
evidence that events of type T
produced by this
are
actually reactive values of type S
a subscription and the reactive with the union of all the events
Creates a union of this
and that
reactive.
Creates a union of this
and that
reactive.
The resulting reactive value emits events from both this
and that
reactive.
It unreacts when both this
and that
reactive unreact.
another reactive value for the union
a subscription and the reactive value with unified events from this
and that
(reactiveOps: StringAdd).self
(reactiveOps: StringFormat).self
(reactiveOps: ArrowAssoc[ReactiveOps[T]]).x
(Since version 2.10.0) Use leftOfArrow
instead
(reactiveOps: Ensuring[ReactiveOps[T]]).x
(Since version 2.10.0) Use resultOfEnsuring
instead