Skip to main content

Class: SubscribableSetPipe<I, O, HandlerType>

Defined in: src/sdk/sub/SubscribableSetPipe.ts:8

A pipe from an input subscribable set to an output mutable subscribable set. Each key added/removed notification received by the pipe is used to add/remove keys to/from the output set.

Extends​

Type Parameters​

Type Parameter
I
O
HandlerType extends (set, type, key, ...args) => void

Constructors​

Constructor​

new SubscribableSetPipe<I, O, HandlerType>(from, to, onDestroy): SubscribableSetPipe<I, O, HandlerType>

Defined in: src/sdk/sub/SubscribableSetPipe.ts:17

Constructor.

Parameters​

ParameterTypeDescription
fromSubscribableSet<I>The input subscribable set.
toMutableSubscribableSet<I>The output mutable subscribable set.
onDestroy(sub) => voidA function which is called when this subscription is destroyed.

Returns​

SubscribableSetPipe<I, O, HandlerType>

Overrides​

HandlerSubscription.constructor

Constructor​

new SubscribableSetPipe<I, O, HandlerType>(from, to, map, onDestroy): SubscribableSetPipe<I, O, HandlerType>

Defined in: src/sdk/sub/SubscribableSetPipe.ts:25

Constructor.

Parameters​

ParameterTypeDescription
fromSubscribableSet<I>The input subscribable set.
toMutableSubscribableSet<O>The output mutable subscribable set.
map(from) => OA function which transforms this pipe's input keys.
onDestroy(sub) => voidA function which is called when this subscription is destroyed.

Returns​

SubscribableSetPipe<I, O, HandlerType>

Overrides​

HandlerSubscription<HandlerType>.constructor

Properties​

canInitialNotify​

readonly canInitialNotify: boolean

Defined in: src/sdk/sub/HandlerSubscription.ts:20

Whether this subscription supports initial notifications on resume.

Inherited from​

HandlerSubscription.canInitialNotify


handler​

readonly handler: HandlerType

Defined in: src/sdk/sub/HandlerSubscription.ts:31

This subscription's handler. The handler will be called each time this subscription receives a notification from its source.

Inherited from​

HandlerSubscription.handler

Accessors​

isAlive​

Get Signature​

get isAlive(): boolean

Defined in: src/sdk/sub/HandlerSubscription.ts:9

Whether this subscription is alive. Live subscriptions can be freely paused and resumed. Dead subscriptions no longer receive notifications from their sources and will throw an error when attempting to pause or resume them.

Returns​

boolean

Whether this subscription is alive. Live subscriptions can be freely paused and resumed. Dead subscriptions no longer receive notifications from their sources and will throw an error when attempting to pause or resume them.

Inherited from​

HandlerSubscription.isAlive


isPaused​

Get Signature​

get isPaused(): boolean

Defined in: src/sdk/sub/HandlerSubscription.ts:15

Whether this subscription is paused. Paused subscriptions do not receive notifications from their sources until they are resumed.

Returns​

boolean

Whether this subscription is paused. Paused subscriptions do not receive notifications from their sources until they are resumed.

Inherited from​

HandlerSubscription.isPaused

Methods​

destroy()​

destroy(): void

Defined in: src/sdk/sub/HandlerSubscription.ts:81

Destroys this subscription. Once destroyed, this subscription will no longer receive notifications from its source and will throw an error when attempting to pause or resume it.

Returns​

void

Inherited from​

HandlerSubscription.destroy


initialNotify()​

initialNotify(): void

Defined in: src/sdk/sub/HandlerSubscription.ts:42

Sends an initial notification to this subscription.

Returns​

void

Throws​

Error if this subscription is not alive.

Inherited from​

HandlerSubscription.initialNotify


pause()​

pause(): this

Defined in: src/sdk/sub/HandlerSubscription.ts:51

Pauses this subscription. Once paused, this subscription will not receive notifications from its source until it is resumed.

Returns​

this

This subscription, after it has been paused.

Throws​

Error if this subscription is not alive.

Inherited from​

HandlerSubscription.pause


resume()​

resume(initialNotify): this

Defined in: src/sdk/sub/HandlerSubscription.ts:62

Resumes this subscription. Once resumed, this subscription will receive notifications from its source.

Parameters​

ParameterTypeDefault valueDescription
initialNotifybooleanfalseWhether to immediately send a notification to this subscription's handler when it is resumed if this subscription supports initial notifications. Defaults to false.

Returns​

this

This subscription, after it has been resumed.

Throws​

Error if this subscription is not alive.

Inherited from​

HandlerSubscription.resume