Skip to main content

Class: DeltaPacer<E>

A PublishPacer that only allows publishing when a value has changed by a specifed amount from the prior publish.

Type parameters

Name
E

Constructors

constructor

new DeltaPacer<E>(delta): DeltaPacer<E>

Create a DeltaPacer.

Type parameters

Name
E

Parameters

NameTypeDescription
deltanumberThe difference required for publishing to be allowed.

Returns

DeltaPacer<E>

Defined in

src/sdk/data/EventBusPacer.ts:58

Methods

canPublish

canPublish<K>(topic, data): boolean

Determine whether the data can be published based on its delta from the pror publish.

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameTypeDescription
topickeyof EThe topic data would be sent on.
datanumberThe data which would be sent.

Returns

boolean

A bool indicating if the data should be published.

Defined in

src/sdk/data/EventBusPacer.ts:70