useDebounceCallback
Creates a debounced version of a callback function with leading, trailing, maxWait, cancel, and flush support.
The useDebounceCallback hook returns a stable, debounced version of a callback that delays invocation until delay milliseconds have elapsed since the last call, and exposes .cancel(), .flush(), and .isPending() control methods.
Installation
Usage
Examples
Leading Edge and maxWait
Configure leading: true to invoke immediately on the first call, or set maxWait to guarantee execution at regular intervals during continuous input.
Flushing and Cancelling Pending Calls
Call .flush() to immediately execute a pending invocation (for example, on form submit or blur) or .cancel() to discard it.
API Reference
DebounceOptions
Configuration options for controlling debounce timing and execution edges.
leading?trailing?maxWait?DebouncedFunction
Debounced function returned by the hook, augmented with control methods.
cancelrequiredflushrequiredisPendingrequiredtrue if there is a pending delayed invocation