Custom hook that returns a delayed callback function.
const delayedCallback = useDelayedCallback(1000);delayedCallback(() => console.log('foo')); // This will log 'foo' after 1 second. Copy
const delayedCallback = useDelayedCallback(1000);delayedCallback(() => console.log('foo')); // This will log 'foo' after 1 second.
The delay in milliseconds before the callback can be executed.
Custom hook that returns a delayed callback function.
Example