Skip to main content

Class: ConsumerValue<T>

Captures the state of a value from a consumer.

Type parameters

Name
T

Implements

Properties

canInitialNotify

Readonly canInitialNotify: true

Whether this subscription supports initial notifications on resume.

Implementation of

Subscription.canInitialNotify

Defined in

src/sdk/data/ConsumerValue.ts:15

Accessors

isAlive

get isAlive(): boolean

Whether this object is alive. While alive, this object will update its value from its event consumer unless it is paused. Once dead, this object will no longer update its value and cannot be resumed again.

Returns

boolean

Implementation of

Subscription.isAlive

Defined in

src/sdk/data/ConsumerValue.ts:28


isPaused

get isPaused(): boolean

Whether event consumption is currently paused. While paused, this object's value will not update.

Returns

boolean

Implementation of

Subscription.isPaused

Defined in

src/sdk/data/ConsumerValue.ts:37

Methods

destroy

destroy(): void

Destroys this object. Once destroyed, it will no longer consume events to update its value.

Returns

void

Implementation of

Subscription.destroy

Defined in

src/sdk/data/ConsumerValue.ts:110


get

get(): T

Gets this item's state.

Returns

T

This item's state.

Implementation of

Accessible.get

Defined in

src/sdk/data/ConsumerValue.ts:52


pause

pause(): this

Pauses consuming events for this object. Once paused, this object's value will not be updated.

Returns

this

This object, after it has been paused.

Implementation of

Subscription.pause

Defined in

src/sdk/data/ConsumerValue.ts:77


resume

resume(): this

Resumes consuming events for this object. Once resumed, this object's value will be updated from consumed events.

Any initialNotify argument passed to this method is ignored. This object is always immediately notified of its event consumer's value when resumed.

Returns

this

This object, after it has been resumed.

Implementation of

Subscription.resume

Defined in

src/sdk/data/ConsumerValue.ts:96


setConsumer

setConsumer(consumer): this

Sets the consumer from which this object derives its value. If the consumer is null, this object's value will not be updated until a non-null consumer is set.

Parameters

NameTypeDescription
consumernull | Consumer<T>An event consumer.

Returns

this

This object, after its consumer has been set.

Defined in

src/sdk/data/ConsumerValue.ts:62


create

create<T>(consumer, initialValue): ConsumerValue<T>

Creates a new ConsumerValue.

Type parameters

Name
T

Parameters

NameTypeDescription
consumernull | Consumer<T>The consumer to track.
initialValueTThe initial value.

Returns

ConsumerValue<T>

The created ConsumerValue.

Defined in

src/sdk/data/ConsumerValue.ts:121