Class: DebounceTimer
Defined in: src/sdk/utils/time/DebounceTimer.ts:4
A simple timer for handling debounce.
Constructors
Constructor
new DebounceTimer():
DebounceTimer
Returns
DebounceTimer
Methods
clear()
clear():
void
Defined in: src/sdk/utils/time/DebounceTimer.ts:32
Clears this timer of any pending actions. Actions that are cleared will not be executed.
Returns
void
isPending()
isPending():
boolean
Defined in: src/sdk/utils/time/DebounceTimer.ts:11
Checks whether an action is pending on this timer.
Returns
boolean
Whether an action is pending on this timer.
schedule()
schedule(
action
,delay
):void
Defined in: src/sdk/utils/time/DebounceTimer.ts:21
Schedules an action. Waits for a specified amount of time, and executes the action only if no other action is scheduled on this timer during the delay.
Parameters
Parameter | Type | Description |
---|---|---|
action | () => void | The action to schedule. |
delay | number | The debounce delay, in milliseconds. |
Returns
void