Class Timing
Index
Constructors
Methods
Methods
Static
debounce
- debounce<Args>(
callback: (...args: Args[]) => void,
delay: number,
): (...args: Args[]) => void Wraps a callback in a debounced timeout. Delay execution of the callback function until the function has not been called for the given delay in milliseconds.
Type Parameters
Parameters
- callback: (...args: Args[]) => void
A function to execute once the debounced threshold has been passed.
- delay: number
An amount of time in milliseconds to delay.
Returns (...args: Args[]) => void
A wrapped function that can be called to debounce execution.
- callback: (...args: Args[]) => void
Static
doubleClick
- doubleClick(
opts: {
delay?: number;
double?: (event: Event) => void;
single?: (event: Event) => void;
},
): (event: Event) => void Creates a double click event handler that distinguishes between single and double clicks. Calls the
single
callback on a single click and thedouble
callback on a double click. The default double click delay to invoke thedouble
callback is 400 milliseconds.Parameters
Returns (event: Event) => void
The gated double-click handler.
Provides timing related higher-order functions.
This class should not be constructed as it only contains static methods.