Skip to main content

Interface: DataBusItemPublisher<T>

Defined in: src/sdk/data/DataBus.ts:89

A publisher that publishes changes to a DataItem from a data bus.

See​

TypedDataBusHost

Type Parameters​

Type ParameterDescription
TThe value type of the publisher's data item.

Methods​

defineEquality()​

defineEquality(equalityFunc): this

Defined in: src/sdk/data/DataBus.ts:100

Defines equality semantics for this publisher's data item values. The specified equality semantics will be used to determine whether to notify subscribers when an update to the data item is published (subscribers are notified if and only if either the new data item value or status is not equal to the old data item value or status, respectively).

Parameters​

ParameterTypeDescription
equalityFunc(a, b) => boolean | undefinedA function that implements the desired equality semantics by returning whether two data item values are equal. If not defined, then default equality semantics will be used, which state that two values a and b are equal if and only if the strict equality operator (===) evaluates to true for a and b, or both a and b are the numeric value NaN.

Returns​

this


publish()​

Call Signature​

publish(status, value): void

Defined in: src/sdk/data/DataBus.ts:107

Publishes an empty-value update to this publisher's data item.

Parameters​
ParameterTypeDescription
statusEmptyValueThe status to publish, which must be EmptyValue.
valueundefinedThe value to publish, which must be undefined.
Returns​

void

Call Signature​

publish(status, value): void

Defined in: src/sdk/data/DataBus.ts:113

Publishes a value and status update to this publisher's data item.

Parameters​
ParameterTypeDescription
statusNormal | Failed | NoComputedValue | TestingThe status to publish.
valueTThe value to publish.
Returns​

void

Call Signature​

publish<S>(status, value): void

Defined in: src/sdk/data/DataBus.ts:120

Publishes a value and status update to this publisher's data item.

Type Parameters​
Type ParameterDescription
S extends DataItemStatusThe status to publish.
Parameters​
ParameterTypeDescription
statusSThe status to publish.
valueS extends EmptyValue ? undefined : TThe value to publish.
Returns​

void


publishEmpty()​

publishEmpty(): void

Defined in: src/sdk/data/DataBus.ts:126

Publishes an empty-value update to this publisher's data item. The data item's status will be set to DataItemStatus.EmptyValue.

Returns​

void