useDebounce
A hook for debouncing callback functions with cancel functionality
Preview
Basic Debounce
Current:
Debounced (500ms):
With Cancel
Installation
Usage
API Reference
Parameters
| Parameter | Type | Description |
|---|---|---|
callback | (value: string) => void | The function to debounce |
delay | number | The delay in milliseconds |
Return Value
Returns a debounced function with a cancel method attached to it.
| Property | Type | Description |
|---|---|---|
debouncedFn | (value: string) => void | The debounced function |
cancel | () => void | Cancels any pending debounced calls |