@globalfishingwatch/react-map-gl
Version:
A React wrapper for MapboxGL-js and overlay API.
31 lines (23 loc) • 518 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = debounce;
function debounce(func, delay) {
var _this;
var _arguments;
var timeout;
var executeNow = function executeNow() {
timeout = null;
return func.apply(_this, _arguments);
};
return function () {
_this = this;
_arguments = arguments;
if (timeout) {
clearTimeout(timeout);
}
timeout = setTimeout(executeNow, delay);
};
}
//# sourceMappingURL=debounce.js.map