Annotates the input stream using ReactiveOp as the source of annotations.
The output values will have the shape of { value: TIn, annotation: TAnnotation }
.
Meaning that the original value is stored under .value
, and the annotation under .annotation
.
Wrapes an input stream to cache values, optionally providing an initial value
Queue from source
, emitting when thresholds are reached.
The resulting Reactive produces arrays.
Create a new object from input, based on cloning fields rather than a destructured copy. This is useful for event args.
Monitors input reactive values, storing values as they happen to an array. Whenever a new value is emitted, the whole array is sent out, containing current values from each source, or undefined if not yet emitted.
Monitors input reactive values, storing values as they happen to an object. Whenever a new value is emitted, the whole object is sent out, containing current values from each source (or undefined if not yet emitted)
When there is a value from input
, or the reactive is pinged,
this reactive emits the result of fn
.
Drops all values where predicate
function returns true.
Emits time in milliseconds since last message. If it is the first value, 0 is used.
From a source value, yields a field from it. Only works if stream values are objects.
Passes all values where predicate
function returns true.
Initialises a lazy stream Consider also: initLazyStreamWithInitial
Initialises a lazy stream with an initial value. Uses initLazyStream and cache together.
Interpolates to the source value.
Returns true if rx
is a Reactive
Returns true if rx
is a writable Reactive
Initialises a reactive that pipes values to listeners directly.
Returns true if v
has a non-undefined value. Note that sometimes
undefined is a legal value to pass
Pipes the output of one stream into another, in order. The stream returned is a new stream which captures the final output.
Build a graph of reactive dependencies for rx
Resolves various kinds of sources into a Reactive.
If source
is an iterable/generator, it gets wrapped via generator()
.
Resolves a trigger value.
Values from input
are set to the textContent/innerHTML of an element.
For a stream that emits arrays of values, this op will select a single value.
Creates a set of streams each of which receives data from source
.
By default these are lazy and dispose if the upstream source closes.
Splits source
into several duplicated streams.
Returns an object with keys according to labels
.
Each value is a stream which echos the values from source
.
Switcher generates several output streams, labelled according to the values of cases
.
Values from source
are fed to the output streams if their associated predicate function returns true.
Waits for all sources to produce a value, sending the combined results as an array. After sending, it waits again for each source to send at least one value.
Grabs the next value emitted from source
.
By default waits up to a maximum of one second.
Handles subscribing and unsubscribing.
Create a parallel 'tap' of processing
'Taps' the values from 'input', passing them to the 'process' function. Return stream is the input stream, unaffected by what 'process' does.
'Taps' the values from 'input', passing them to 'diverged' Returns the original input stream, unaffected by what 'diverged' does.
Only allow a value through if a minimum amount of time has elapsed. since the last value. This effectively slows down a source to a given number of values/ms. Values emitted by the source which are too fast are discarded.
Pings a reactive if no value is emitted at after interval
.
Returns source
.
Emits a value if source
does not emit a value after interval
has elapsed. This can be useful to reset a reactive to some
'zero' state if nothing is going on.
Connects reactive A to B, optionally transforming the value as it does so.
Reads a set number of values from source
, returning as an array. May contain
empty values if desired values is not reached.
By default, reads all the values from source
, or until 5 seconds has elapsed.
Returns an AsyncGenerator wrapper around Reactive.
This allows values to be iterated over using a for await
loop,
like Chains.
Transforms values from source
using the transformer
function.
Pings target
whenever source
emits a value. The value itself is ignored, it just
acts as a trigger.
A reactive where the last value can be read at any time. An initial value must be provided.
Wrap a reactive source to allow for chained function calls.
A stream that caches its last value
A CacheStream with an initial value
Laziness
A Reactive
A reactive that can be 'pinged' to produce a value.
A reactive stream which can be read and written to
A stream that can be written to
Switcher options.
Transform options
WithValue stream options
Wrapped Reactive for object-oriented access
Annotates values from
source
. Output values will be in the form{ value: TIn, annotation: TAnnotation }
. WhereTIn
is the type of the input, andTAnnotation
is the return type of the annotator function.