@prelude/channel
Version:
Channel module.
13 lines • 496 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.after = void 0;
const channel_js_1 = require("./channel.js");
/** @returns channel that closes after specified time in milliseconds. */
function after(milliseconds) {
const ch = new channel_js_1.Channel();
const timeoutId = setTimeout(() => ch.closeWriting(), milliseconds);
ch.onceDoneWriting(() => clearTimeout(timeoutId));
return ch;
}
exports.after = after;
//# sourceMappingURL=after.js.map