import { SinkInternal } from "@effect/core/stream/Sink/operations/_internal/SinkInternal" /** * @tsplus static effect/core/stream/Sink.Ops collectAll */ export function collectAll(): Sink> { return new SinkInternal(loop(Chunk.empty())) } function loop( acc: Chunk ): Channel, unknown, never, never, Chunk> { return Channel.readWithCause( (chunk: Chunk) => loop(acc + chunk), (cause) => Channel.failCause(cause), () => Channel.succeed(acc) ) }