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
| Parameter | Type | Description |
|---|---|---|
delta | number | The 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
| Parameter | Type | Description |
|---|---|---|
topic | keyof E | The topic data would be sent on. |
data | number | The data which would be sent. |
Returns
boolean
A bool indicating if the data should be published.