Created
April 23, 2016 07:45
-
-
Save jstrellner/3c2f504af223d4f11bcc1e64095fe141 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
// debounce function | |
// | |
// call like: | |
// debouncer(function() { | |
// console.log('do stuff'); | |
// }, 1000); | |
function debouncer(c,to,t){ | |
debouncer=function(c){ | |
clearTimeout(t); | |
t=setTimeout(c,to); | |
}; | |
debouncer(c); | |
return c; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment