Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
debounce js
const debounce = (fn, time) => {
let timerId;
return function(...args) {
const functionCall = () => fn.apply(this, args);
timerId = setTimeout(functionCall, time);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment