@pmwcs/base
Version:
PMWCS base module
24 lines (19 loc) • 465 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.debounce = void 0;
var debounce = function debounce(func, wait) {
var timeout;
return function () {
var context = this;
var args = arguments;
var later = function later() {
timeout = null;
func.apply(context, args);
};
timeout !== null && clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
};
exports.debounce = debounce;