Home > @unseenco/backstage-dataverse > Ticker
Ticker class
The Ticker class helps schedule callbacks. Scheduled callbacks are executed per tick. Ticks can be triggered by an external scheduling strategy, e.g. a raf.
Signature:
export default class TickerConstructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(_conf) | Constructs a new instance of the Ticker class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| __ticks | number | Counts up for every tick executed. Internally, this is used to measure ticks per second. This is "public" to TypeScript, because it's a tool for performance measurements. Consider this as experimental, and do not rely on it always being here in future releases. | |
| dormant | readonly | boolean | Whether the Ticker is dormant |
| time | readonly | number | The time at the start of the current tick if there is a tick in progress, otherwise defaults to performance.now(). |
Methods
| Method | Modifiers | Description |
|---|---|---|
| offNextTick(fn) | De-registers a fn to be called on the next tick. | |
| offThisOrNextTick(fn) | De-registers a fn to be called either on this tick or the next tick. | |
| onNextTick(fn) | Registers a side effect to be called on the next tick. | |
| onThisOrNextTick(fn) | Registers for fn to be called either on this tick or the next tick. If Note that | |
| tick(t) | Triggers a tick which starts executing the callbacks scheduled for this tick. |