debounce
Callable
Type parameters
- T: (...args: any[]) => void
Parameters
fn: T
The function to execute.
ms: number
The amount of time to wait before executing the function.
Returns (...args: Parameters<T>) => void
A new function that will only be executed after being idle for a certain amount of time.
Parameters
rest...args: Parameters<T>
Returns void
Returns a new function that will only be executed after being idle for a certain amount of time. Useful for reducing the number of expensive function calls.