Skip to content

Instantly share code, notes, and snippets.

@griffinmichl
Last active May 17, 2016 20:15
Show Gist options
  • Save griffinmichl/bb49e9785066bc17cc735a90cf27922a to your computer and use it in GitHub Desktop.
Save griffinmichl/bb49e9785066bc17cc735a90cf27922a to your computer and use it in GitHub Desktop.
// still wrong
function debounce(func, wait) {
let timeout
return (...args) => {
const context = this
clearTimeout(timeout)
timeout = setTimeout(() => func.apply(context, args), wait)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment