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
Name | Type | Description |
---|---|---|
delta | number | The 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
Name | Type |
---|---|
K | extends string | number | symbol |
Parameters
Name | 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.
Defined in
src/sdk/data/EventBusPacer.ts:70