Skip to content

Instantly share code, notes, and snippets.

@jasonmoo
Created July 3, 2014 19:25
Show Gist options
  • Save jasonmoo/83e2f110e9c3a99d4181 to your computer and use it in GitHub Desktop.
Save jasonmoo/83e2f110e9c3a99d4181 to your computer and use it in GitHub Desktop.
function mitigated_event(f, t) {
var timeout;
return function(e) {
clearTimeout(timeout);
timeout = setTimeout(function() { f(e); }, t);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment