by Abba Sali Aboubakar Mamate
function debounce(fn, delay = 300) { let timeoutId; return (...args) => { clearTimeout(timeoutId); timeoutId = setTimeout(() => fn(...args), delay); }; }
No comments yet.
Sign in to leave a comment.