useDebounceCallback ​
Hook that creates a debounced callback and returns a stable reference of it
typescript
import { useDebounceCallback } from '@siberiacancode/reactuse';
Usage ​
typescript
const debounced = useDebounceCallback(() => console.log('callback'), 500);
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
callback | (...args: Params) => Return | - | The callback function |
delay | number | - | The delay in milliseconds |