code: function (func, delay) {
      var timer = null;
  
      return function () {
        var context = this, args = arguments;
  
        if (timer === null) {
          timer = setTimeout(function () {
            func.apply(context, args);
            timer = null;
          }, delay);
        }
      };
    }
docs: Function for applying a debounce effect to a function call.
  @function
  @param {Function} func - Function to be called at end of timeout.
  @param {Number} delay - Time in ms to delay the call of `func`.
  @returns function