moltres-utils
Version:
Utils for Moltres apps
19 lines (15 loc) • 423 B
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
const delay = (func, wait, ...args) => {
if (typeof func !== 'function') {
throw new TypeError('Expected a function');
}
const timeoutId = setTimeout(func, +wait || 0, ...args);
return () => clearTimeout(timeoutId);
};
var _default = delay;
exports.default = _default;
//# sourceMappingURL=delay.js.map
;