Wraps an array object.
Produces an incrementing value. By default starts at 0 and counts forever, incrementing every second.
Subscribes to an event, emitting data
Fired when eventName
fires on target
.
Emits a value whenever event happens.
Data emitted is { sinceLast, total }
, where 'sinceLast'
is milliseconds since last event and 'total' is total number of
times event has been fired.
Produces a reactive from the basis of a function. callback
is executed, with its result emitted via the returned reactive.
Creates a readable reactive based on a (async)generator or iterator
Returns a stream that merges the output of a list of homogenous streams. Use mergedWithOptions to specify additional options.
Returns a stream that merges the output of a list of homogenous streams.
Creates a Reactive wrapper with the shape of the input object.
Creates a proxy of target
object (or array), so that regular property setting will be intercepted and output
on a Reactive object as well.
Same as objectProxy, but the return value is the proxied object along with the Reactive wrapped as symbol property.
Creates a RxJs style observable
const o = observable(stream => {
// Code to run for initialisation when we go from idle to at least one subscriber
// Won't run again for additional subscribers, but WILL run again if we lose
As observable, but returns a Reactive that allows writing
Options when creating a reactive object.
Options for the 'count' source.
Function which returns a result. Or promised result.
Options when creating a reactive object.
Function which returns a result. Or promised result.
Takes a value
as first parameter, and callback to signal an abort as the second.
A trigger can be a value, a function or generator. Value triggers never complete.
Trigger that calls a fn
.
If fn
returns undefined, it means the trigger is complete
Reads the contents of
array
into a Reactive, with optional time interval between values. A copy of the array is used, so changes will not affect the reactive.