Class: SubscribableSetPipe<I, O, HandlerType>
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.
Type parameters
Name | Type |
---|---|
I | I |
O | O |
HandlerType | extends (set : ReadonlySet <I >, type : SubscribableSetEventType , key : I , ...args : any []) => void |
Hierarchy
HandlerSubscription
<HandlerType
>↳
SubscribableSetPipe
Constructors
constructor
• new SubscribableSetPipe<I
, O
, HandlerType
>(from
, to
, onDestroy
): SubscribableSetPipe
<I
, O
, HandlerType
>
Constructor.
Type parameters
Name | Type |
---|---|
I | I |
O | O |
HandlerType | extends (set : ReadonlySet <I >, type : SubscribableSetEventType , key : I , ...args : any []) => void |
Parameters
Name | Type | Description |
---|---|---|
from | SubscribableSet <I > | The input subscribable set. |
to | MutableSubscribableSet <I > | The output mutable subscribable set. |
onDestroy | (sub : SubscribableSetPipe <I , O , HandlerType >) => void | A function which is called when this subscription is destroyed. |
Returns
SubscribableSetPipe
<I
, O
, HandlerType
>
Overrides
HandlerSubscription.constructor
Defined in
src/sdk/sub/SubscribableSetPipe.ts:17
• new SubscribableSetPipe<I
, O
, HandlerType
>(from
, to
, map
, onDestroy
): SubscribableSetPipe
<I
, O
, HandlerType
>
Constructor.
Type parameters
Name | Type |
---|---|
I | I |
O | O |
HandlerType | extends (set : ReadonlySet <I >, type : SubscribableSetEventType , key : I , ...args : any []) => void |
Parameters
Name | Type | Description |
---|---|---|
from | SubscribableSet <I > | The input subscribable set. |
to | MutableSubscribableSet <O > | The output mutable subscribable set. |
map | (from : I ) => O | A function which transforms this pipe's input keys. |
onDestroy | (sub : SubscribableSetPipe <I , O , HandlerType >) => void | A function which is called when this subscription is destroyed. |
Returns
SubscribableSetPipe
<I
, O
, HandlerType
>
Overrides
HandlerSubscription\<HandlerType\>.constructor
Defined in
src/sdk/sub/SubscribableSetPipe.ts:25
Properties
canInitialNotify
• Readonly
canInitialNotify: boolean
Whether this subscription supports initial notifications on resume.
Inherited from
HandlerSubscription.canInitialNotify
Defined in
src/sdk/sub/HandlerSubscription.ts:20
handler
• Readonly
handler: HandlerType
This subscription's handler. The handler will be called each time this subscription receives a notification from its source.
Inherited from
Defined in
src/sdk/sub/HandlerSubscription.ts:31
Accessors
isAlive
• get
isAlive(): 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.
Returns
boolean
Inherited from
HandlerSubscription.isAlive
Defined in
src/sdk/sub/HandlerSubscription.ts:9
isPaused
• get
isPaused(): boolean
Whether this subscription is paused. Paused subscriptions do not receive notifications from their sources until they are resumed.
Returns
boolean
Inherited from
HandlerSubscription.isPaused
Defined in
src/sdk/sub/HandlerSubscription.ts:15
Methods
destroy
▸ destroy(): void
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
Defined in
src/sdk/sub/HandlerSubscription.ts:81
initialNotify
▸ initialNotify(): void
Sends an initial notification to this subscription.
Returns
void
Throws
Error if this subscription is not alive.
Inherited from
HandlerSubscription.initialNotify
Defined in
src/sdk/sub/HandlerSubscription.ts:42
pause
▸ pause(): this
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
Defined in
src/sdk/sub/HandlerSubscription.ts:51
resume
▸ resume(initialNotify?
): this
Resumes this subscription. Once resumed, this subscription will receive notifications from its source.
Parameters
Name | Type | Default value | Description |
---|---|---|---|
initialNotify | boolean | false | Whether 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
Defined in
src/sdk/sub/HandlerSubscription.ts:62