Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Debounce from Scratch
const debounce = (callback, wait) => {
let timeout = null;
return (...args) => {
timeout = setTimeout(() => {
callback.apply(this, args);
}, wait);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment