function throttle(functionToThrottle, minimumInterval, optionalContext) {
  var lastTime;
  if (optionalContext) {
    functionToThrottle = functionToThrottle.bind(optionalContext);
  }
  return function () {
    var time = Date.now();
    var sinceLastTime = typeof lastTime === 'undefined' ? minimumInterval : time - lastTime;
    if (typeof lastTime === 'undefined' || sinceLastTime >= minimumInterval) {
      lastTime = time;
      functionToThrottle.apply(null, arguments);
    }
  };
}
Returns throttle function that gets called at most once every interval.

@param {function} functionToThrottle
@param {number} minimumInterval - Minimal interval between calls (milliseconds).
@param {object} optionalContext - If given, bind function to throttle to this context.
@returns {function} Throttled function.