Skip to content

Instantly share code, notes, and snippets.

@arthurariza
Created March 6, 2023 23:05
Show Gist options
  • Save arthurariza/46dcf88abc37f54187a9d0ee5902522c to your computer and use it in GitHub Desktop.
Save arthurariza/46dcf88abc37f54187a9d0ee5902522c to your computer and use it in GitHub Desktop.
Debounce
const debounce = () => {
let timeoutId;
return () => {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
console.log('Run Function');
}, 2000);
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment