t3kkitz
11/17/2017 - 6:58 AM

debounce func simple vanilla

function debounce(func, delay) {
  let timeout
  return function (...args) {
    clearTimeout(timeout)
    timeout = setTimeout(func.bind(this, ...args), delay)
  }
}