Home > @cascadiacollections/fluentui-compat > Async > throttle
Async.throttle() method
Creates an ultra-optimized throttle function with minimal memory allocations.
Throttling limits function execution to at most once per specified time period. This is useful for performance-critical events like scroll or resize handlers.
Signature:
throttle<T extends (...args: any[]) => any>(func: T, wait?: number, options?: ThrottleOptions): T;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
func |
T |
The function to throttle |
|
wait |
number |
(Optional) Minimum time between executions in milliseconds (default: 0) |
|
options |
ThrottleOptions |
(Optional) Configuration options for throttle behavior |
Returns:
T
Throttled version of the input function