UNPKG

@prelude/channel

Version:

Channel module.

9 lines 360 B
import { Channel } from './channel.js'; /** @returns channel that closes after specified time in milliseconds. */ export function after(milliseconds) { const ch = new Channel(); const timeoutId = setTimeout(() => ch.closeWriting(), milliseconds); ch.onceDoneWriting(() => clearTimeout(timeoutId)); return ch; } //# sourceMappingURL=after.js.map