Created
July 28, 2014 11:26
-
-
Save A/675ee7985c77043667ea to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function debounce(cb, timeout) { | |
var timer; | |
return function () { | |
timer && clearTimeout(timer); | |
timer = setTimeout(function () { | |
cb.apply(this, arguments); | |
}, timeout); | |
}.bind(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment