#
Module: "urx/src/actions"urx Actions operate on streams - publish
publishes data in a stream, and subscribe
attaches a subscription to a stream.
#
Index#
Interfaces#
Functions#
Functions#
connectâ–¸ connect<T>(emitter
: Emitter<T>, publisher
: Publisher<T>): Unsubscribe
Defined in urx/src/actions.ts:132
Connects two streams - any value emitted from the emitter will be published in the publisher.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
emitter | Emitter<T> |
publisher | Publisher<T> |
Returns: Unsubscribe
an Unsubscribe handle which will disconnect the two streams.
#
getValueâ–¸ getValue<T>(depot
: StatefulStream<T>): T
Defined in urx/src/actions.ts:116
Extracts the current value from a stateful stream. Use it only as an escape hatch, as it violates the concept of reactive programming.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
depot | StatefulStream<T> |
Returns: T
#
handleNextâ–¸ handleNext<T>(emitter
: Emitter<T>, subscription
: Subscription<T>): Unsubscribe
Defined in urx/src/actions.ts:146
Executes the passed subscription at most once, for the next emit from the emitter.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
emitter | Emitter<T> |
subscription | Subscription<T> |
Returns: Unsubscribe
an Unsubscribe handle to unbind the subscription if necessary.
#
publishâ–¸ publish<T>(publisher
: Publisher<T>, value
: T): void
Defined in urx/src/actions.ts:92
Publishes the value into the passed Publisher.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
publisher | Publisher<T> |
value | T |
Returns: void
#
resetâ–¸ reset(emitter
: Emitter<any>): void
Defined in urx/src/actions.ts:105
Clears all subscriptions from the Emitter.
#
Parameters:Name | Type |
---|---|
emitter | Emitter<any> |
Returns: void
#
subscribeâ–¸ subscribe<T>(emitter
: Emitter<T>, subscription
: Subscription<T>): Unsubscribe
Defined in urx/src/actions.ts:80
Subscribes the specified Subscription to the updates from the Emitter. The emitter calls the subscription with the new data each time new data is published into it.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
emitter | Emitter<T> |
subscription | Subscription<T> |
Returns: Unsubscribe
an Unsubscribe handle - calling it will unbind the subscription from the emitter.