The function to be debounced.
Optional
delayMs: numberDefaults to 5 seconds.
Optional
The debounced function.
Rest
...args: Parameters<T>Rest
const debouncedFunction = debounce(e => {
console.log(e);
}, 5000);
// Console logs 'Hello world again ' after 5 seconds
debouncedFunction('Hello world');
debouncedFunction('Hello world again');
Generated using TypeDoc
Wait before calling the same function. Useful for expensive calls. Adapted from https://amitd.co/code/typescript/debounce.