Skip to content

Instantly share code, notes, and snippets.

@vgoodvin
Last active August 29, 2015 13:57
Show Gist options
  • Save vgoodvin/9365982 to your computer and use it in GitHub Desktop.
Save vgoodvin/9365982 to your computer and use it in GitHub Desktop.
var typewatch = (function() {
var timer;
timer = 0;
return function(callback, ms) {
clearTimeout(timer);
return timer = setTimeout(callback, ms);
};
})();
// Using
typewatch((function() { /* Do something */ }), 500);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment