import type { AsyncInputConsumer } from "@effect/core/stream/Channel/SingleProducerAsyncInput" /** * @tsplus static effect/core/stream/Channel.Ops fromInput */ export function fromInput( input: AsyncInputConsumer ): Channel { return Channel.unwrap( input.takeWith( (cause) => Channel.failCause(cause), (elem) => Channel.write(elem).flatMap(() => fromInput(input)), (done) => Channel.succeed(done) ) ) }