Created
February 14, 2023 16:25
-
-
Save benmotyka/c701a201ac430e5c9b9f2d8d42d47f9c to your computer and use it in GitHub Desktop.
This file contains 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
function debounce(func, timeINMS) { | |
let timeout; | |
return function () { | |
clearTimeout(timeout); | |
timeout = setTimeout(func, timeINMS); | |
}; | |
} | |
let debouncedHello = debounce(() => console.log("say hello", Date.now()), 1000); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment