Home > @cascadiacollections/fluentui-compat > Async > debounce
Async.debounce() method
Creates an ultra-optimized debounce function with advanced state management.
Debouncing delays function execution until after the specified wait time has elapsed since the last invocation. This is ideal for expensive operations triggered by frequent events like typing or API calls.
Signature:
debounce<T extends (...args: any[]) => any>(func: T, wait?: number, options?: DebounceOptions): ICancelable<T> & T;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
func |
T |
The function to debounce |
|
wait |
number |
(Optional) Delay time in milliseconds (default: 0) |
|
options |
DebounceOptions |
(Optional) Configuration options for debounce behavior |
Returns:
ICancelable<T> & T
Debounced function with cancel, flush, and pending methods