// ets_tracing: off import * as C from "../core.js" /** * Returns a new channel which reads all the elements from upstream's output channel * and ignores them, then terminates with the upstream result value. */ export function drain( self: C.Channel ): C.Channel { const drainer: C.Channel = C.readWithCause((_) => drainer, C.failCause, C.end) return self[">>>"](drainer) }