function debounce (fn, wait) {
  let t
  return function () {
    clearTimeout(t)
    t = setTimeout(() => fn.apply(this, arguments), wait)
  }
}
/**
 * Debounce function calls
 * @param {Function} fn Function to be debounced
 * @param {number} wait Debounce time
 */
Debounce function calls
@param {Function} fn Function to be debounced
@param {number} wait Debounce time
Debounce function calls @param { Function } fn Function to be debounced @param { number } wait Debounce time
function debounce (fn, wait) {
  let t
  return function () {
    clearTimeout(t)
    t = setTimeout(() => fn.apply(this, arguments), wait)
  }
}
function debounce ( fn , wait ) { let t return function ( ) { clearTimeout ( t ) t = setTimeout ( ( ) => fn . apply ( this , arguments ) , wait ) } }
Debounce function calls
 @param {Function} fn Function to be debounced
 @param {number} wait Debounce time
Debounce function calls @param { Function } fn Function to be debounced @param { number } wait Debounce time