Skip to main content

Class: DebounceTimer

A simple timer for handling debounce.

Constructors

constructor

new DebounceTimer(): DebounceTimer

Returns

DebounceTimer

Methods

clear

clear(): void

Clears this timer of any pending actions. Actions that are cleared will not be executed.

Returns

void

Defined in

src/sdk/utils/time/DebounceTimer.ts:32


isPending

isPending(): boolean

Checks whether an action is pending on this timer.

Returns

boolean

Whether an action is pending on this timer.

Defined in

src/sdk/utils/time/DebounceTimer.ts:11


schedule

schedule(action, delay): void

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

NameTypeDescription
action() => voidThe action to schedule.
delaynumberThe debounce delay, in milliseconds.

Returns

void

Defined in

src/sdk/utils/time/DebounceTimer.ts:21