Created
March 6, 2023 23:05
-
-
Save arthurariza/46dcf88abc37f54187a9d0ee5902522c to your computer and use it in GitHub Desktop.
Debounce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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