EventSource

The EventSource class provides methods for monitoring signals.

Properties

This module exposes no properties.

Methods

Method

Description

select

select(property: string): EventSource

Converts event source by selecting a property in the event object. Events without specified property are ignored.

skip

skip(count: number): EventSource

Yields a filtered event source: the first count events from the original source are dropped, and subsequent ones signaled.

subscribe

subscribe(callback: (event: mixed) => void): Subscription

Sets a callback for the event source. The callback will be invoked every time an event is emitted from this EventSource.

See Also: Subscription.unsubscribe.

Note: subscribe and subscribeOnNext functions are completely equivalent.

subscribeOnNext

subscribeOnNext(callback: (event: mixed) => void): Subscription

Sets a callback for the event source. The callback will be invoked every time an event is emitted from this EventSource.

See Also: Subscription.unsubscribe.

Note: subscribe and subscribeOnNext functions are completely equivalent.

subscribeWithSnapshot

subscribeWithSnapshot(snapshot: { [name: string]: Signal}, callback: (event: mixed, snapshot: mixed) => void): Subscription

Sets a callback for the event source, similar to Subscribe function, but with additional Snapshot parameter. Snapshot is a dictionary of String/Bool/Scalar signals, which will be passed as JSON to the callback function using lastValue from requested signals

take

take(count: number): EventSource

Yields a filtered event source: the first count events from the original source are signaled, and subsequent ones ignored.

Last updated