throttle
Callable
Type parameters
- T: (...args: any[]) => ReturnType<T>
Parameters
fn: T
The function to be throttled.
ms: number
The number of milliseconds to throttle invocations to.
Returns (...args: Parameters<T>) => ReturnType<T>
A new function that wraps fn with throttling behavior.
Parameters
rest...args: Parameters<T>
Returns ReturnType<T>
Returns a new function that, when invoked repeatedly, invokes fn at most once per every ms milliseconds.