Created
May 17, 2015 17:54
-
-
Save IanRamosC/e315a42459a8a7beb1f5 to your computer and use it in GitHub Desktop.
Debounce Concept
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
var debounce = function(handler, delay) { | |
var timeout; | |
return function() { | |
clearTimeout(timeout); | |
timeout = setTimeout(function() { | |
handler(); | |
}, delay); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment