function debounce(f, waitMs) {
	  var lastTime = now();
	  var lastResult;

	  var f2 = function f2() {
	    var now$1 = now();

	    if (now$1 - lastTime < waitMs) {
	      return lastResult;
	    }

	    lastTime = now$1;
	    lastResult = f.apply(void 0, arguments);
	    return lastResult;
	  };

	  return f2;
	}
Returns a function `f2` (decorator) which wraps the original function
`f`. `f2` guarantees that `f` can be called at most once
every `waitMs` ms. If `f2` is called more often, it will return
the last returned result of `f`.

@param f The original function `f` to wrap.
@param waitMs The time between two consecutive calls to `f` in ms.