Skip to content

Instantly share code, notes, and snippets.

@griffinmichl
Last active May 17, 2016 20:15
Show Gist options
  • Save griffinmichl/7157da3526eca0033b85457e649bfbe0 to your computer and use it in GitHub Desktop.
Save griffinmichl/7157da3526eca0033b85457e649bfbe0 to your computer and use it in GitHub Desktop.
// 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