Created
October 21, 2020 16:15
-
-
Save b-aleksei/da1c4c156691e3380549f3b615a1db36 to your computer and use it in GitHub Desktop.
function debounce(func, ms) { let timeout; return () => { clearTimeout(timeout); timeout = setTimeout(() => { func(); }, ms); };
debounce
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, ms) { | |
let timeout; | |
return () => { | |
clearTimeout(timeout); | |
timeout = setTimeout(() => { | |
func(); | |
}, ms); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment