Skip to main content

Class: DeltaPacer<E>

Defined in: src/sdk/data/EventBusPacer.ts:50

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

Type Parameters

Type Parameter
E

Constructors

Constructor

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

Defined in: src/sdk/data/EventBusPacer.ts:58

Create a DeltaPacer.

Parameters

ParameterTypeDescription
deltanumberThe difference required for publishing to be allowed.

Returns

DeltaPacer<E>

Methods

canPublish()

canPublish<K>(topic, data): boolean

Defined in: src/sdk/data/EventBusPacer.ts:70

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

Type Parameters

Type Parameter
K extends string | number | symbol

Parameters

ParameterTypeDescription
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.