Const
Wait before calling the same function. Useful for expensive calls. Adapted from https://amitd.co/code/typescript/debounce.
The function to be debounced.
Optional
Defaults to 5 seconds.
The debounced function.
const debouncedFunction = debounce(e => { console.log(e);}, 5000);// Console logs 'Hello world again ' after 5 secondsdebouncedFunction('Hello world');debouncedFunction('Hello world again'); Copy
const debouncedFunction = debounce(e => { console.log(e);}, 5000);// Console logs 'Hello world again ' after 5 secondsdebouncedFunction('Hello world');debouncedFunction('Hello world again');
Wait before calling the same function. Useful for expensive calls. Adapted from https://amitd.co/code/typescript/debounce.