effect-io-ai

Package: effect
Module: Channel

Channel.fromAsyncIterableArray

Creates a channel from an AsyncIterable, emitting each yielded value as a single-element non-empty array.

Details

The iterator’s return value becomes the channel’s done value. Thrown or rejected iterator errors are converted with onError. If the channel scope closes early and the iterator has a return method, that method is called.

Signature

declare const fromAsyncIterableArray: <A, D, E>(iterable: AsyncIterable<A, D>, onError: (error: unknown) => E) => Channel<Arr.NonEmptyReadonlyArray<A>, E, D>

Source

Since v4.0.0