Answers for "How to create a debounce higher order function"

0

How to create a debounce higher order function

const debounce = (fn, delay) => {
  let _timerId;

  return (...args) => {
    clearTimeout(_timerId);

    _timerId = setTimeout(() => {
      fn(...args);
    }, delay);
  };
};
Posted by: Guest on February-16-2022

Code answers related to "How to create a debounce higher order function"

Browse Popular Code Answers by Language