Skip to content

Instantly share code, notes, and snippets.

@dSalieri
Last active July 24, 2021 23:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dSalieri/6a3c1ecd8065976712102be3ff7b00df to your computer and use it in GitHub Desktop.
Save dSalieri/6a3c1ecd8065976712102be3ff7b00df to your computer and use it in GitHub Desktop.
Light template of debounce
function debounce(func, delay) {
let timerId;
return function (args) {
clearTimeout(timerId);
timerId = setTimeout(function () {
func(args);
}, delay);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment