UNPKG

ever-given

Version:

A package that blocks the flow of a specific channel

18 lines 614 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.block = exports.noop = void 0; exports.noop = function () { }; /** * @param {number} blockTime The time the channel should be blocked * @param {Function} channel The code to execute once the block is lifted * @returns */ exports.block = function (blockTime, channel) { if (channel === void 0) { channel = exports.noop; } return new Promise(function (resolve, _reject) { setTimeout(function () { resolve(channel); }, blockTime); }); }; //# sourceMappingURL=index.js.map