core/util.js
function debounce(f, delay) {
  var timeoutId = null;

  return function debounceExecute_() {
    clearTimeout(timeoutId);
    var lastArgs = arguments;

    timeoutId = setTimeout(function() {
      timeoutId = null;
      f.apply(null, lastArgs);
    }, delay);
  };
}
function debounce(f, delay) {
  var timeoutId = null;

  return function debounceExecute_() {
    clearTimeout(timeoutId);
    var lastArgs = arguments;

    timeoutId = setTimeout(function() {
      timeoutId = null;
      f.apply(null, lastArgs);
    }, delay);
  };
}
function debounce ( f , delay ) { var timeoutId = null ; return function debounceExecute_ ( ) { clearTimeout ( timeoutId ) ; var lastArgs = arguments ; timeoutId = setTimeout ( function ( ) { timeoutId = null ; f . apply ( null , lastArgs ) ; } , delay ) ; } ; }
Debounce a function.
@param {function} f The function.
@param {number} delay The delay in ms.
@return {function} A function which calls the passed-in function debounced.
Debounce a function .