polestar-ui-kit
Version:
## Install
27 lines (22 loc) • 558 B
JavaScript
;
require("core-js/modules/web.timers");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _arguments = arguments,
_this = void 0;
var debounce = function debounce(fn, delay) {
var timer = null;
return function () {
var context = _this;
var args = _arguments;
clearTimeout(timer);
timer = setTimeout(function () {
console.log('debounce', context, args);
fn.apply(context, args);
}, delay);
};
};
var _default = debounce;
exports["default"] = _default;