Home > @lndsld/react-hooks > useDebouncedCallback
Apply debounce to callback
If callback wasn’t invoked during specified time, last call will be invoked
Signature:
declare function useDebouncedCallback<P extends unknown[]>(callback: EventCallback<P>, delay?: number): EventCallback<P>;
Parameter | Type | Description |
---|---|---|
callback | EventCallback<P> | callback to debounce |
delay | number | (Optional) debounce time (if zero or undefined, debounce will not be applied) |
Returns:
debounced callback