Function debounce
- debounce<T>(fn, wait): DebouncedFunction<T>
Type Parameters
Parameters
- fn: ((this: DebouncedFunction<T>, ...args: T) => void)
The function to debounce.
- (this, ...args): void
Parameters
- this: DebouncedFunction<T>
Rest...args: T
Returns void
- wait: number
The time in milliseconds to delay the function.
Returns DebouncedFunction<T>
The debounced function.
- fn: ((this: DebouncedFunction<T>, ...args: T) => void)
Creates a debounced function that delays the given
funcby a givenwaittime in milliseconds. If the method is called again before the timeout expires, the previous call will be aborted.