Last active
May 17, 2016 20:15
-
-
Save griffinmichl/7157da3526eca0033b85457e649bfbe0 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
// the wrong way | |
function debounce(func, wait) { | |
let timeout | |
return (...args) => { | |
clearTimeout(timeout) | |
timeout = setTimeout(() => func(...arg), wait) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment