#
Module: "urx/src/streams"Streams are the basic building blocks of a reactive system. Think of them as the system permanent "data tubes".
A stream acts as both an Emitter and Publisher. Each stream can have multiple Subscriptions.
urx streams are either stateless or stateful. Stateless streams emit data to existing subscriptions when published, without keeping track of it. Stateful streams remember the last published value and immediately publish it to new subscriptions.
#
Index#
Functions#
Functions#
eventHandlerâ–¸ eventHandler<T>(emitter
: Emitter<T>): Emitter<T>
Defined in urx/src/streams.ts:121
Event handlers are special emitters which can have at most one active subscription. Subscribing to an event handler unsubscribes the previous subscription, if present.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type | Description |
---|---|---|
emitter | Emitter<T> | the source emitter. |
Returns: Emitter<T>
the single-subscription emitter.
#
statefulStreamâ–¸ statefulStream<T>(initial
: T): StatefulStream<T>
Defined in urx/src/streams.ts:83
Constructs a new stateful stream.
#
Type parameters:Name | Description |
---|---|
T | the type of values to publish in the stream. If omitted, the function infers it from the initial value. |
#
Parameters:Name | Type | Description |
---|---|---|
initial | T | the initial value in the stream. |
Returns: StatefulStream<T>
#
statefulStreamFromEmitterâ–¸ statefulStreamFromEmitter<T>(emitter
: Emitter<T>, initial
: T): StatefulStream<T>
Defined in urx/src/streams.ts:224
Creates and connects a "junction" stateful stream to the specified emitter. Often used with pipe, to avoid the multiple evaluation of operator sets.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type | Description |
---|---|---|
emitter | Emitter<T> | - |
initial | T | the initial value in the stream. |
Returns: StatefulStream<T>
the resulting stateful stream.
#
streamâ–¸ stream<T>(): Stream<T>
Defined in urx/src/streams.ts:47
Constructs a new stateless stream.
#
Type parameters:Name | Description |
---|---|
T | the type of values to publish in the stream. |
Returns: Stream<T>
a Stream
#
streamFromEmitterâ–¸ streamFromEmitter<T>(emitter
: Emitter<T>): Stream<T>
Defined in urx/src/streams.ts:185
Creates and connects a "junction" stream to the specified emitter. Often used with pipe, to avoid the multiple evaluation of operator sets.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
emitter | Emitter<T> |
Returns: Stream<T>
the resulting stream.