(
self: Stream<A, E, R>,
f: (pull: Pull.Pull<Arr.NonEmptyReadonlyArray<A>, E, void>, scope: Scope.Scope) => Effect.Effect<
Pull.Pull<Arr.NonEmptyReadonlyArray<B>, E2, void, R2>,
EX,
RX
>
)
| 640 | /** |
| 641 | * Creates a channel from a stream. |
| 642 | * |
| 643 | * **Example** (Converting a stream to a channel) |
| 644 | * |
| 645 | * ```ts import.meta.vitest |
| 646 | * import { Channel, Effect, Stream } from "effect" |
| 647 | * |
| 648 | * const channel = Stream.toChannel(Stream.make(1, 2, 3)) |
| 649 | * const values = await Effect.runPromise(Channel.runCollect(channel)) |
| 650 | * values.flat() // => [1, 2, 3] |
| 651 | * ``` |
| 652 | * |
| 653 | * @category constructors |
| 654 | * @since 2.0.0 |
| 655 | */ |
| 656 | export const toChannel = <A, E, R>( |
| 657 | stream: Stream<A, E, R> |
no test coverage detected
searching dependent graphs…