Hyperlinkv0.8.0-beta.28

Channel

Channel.fromAsyncIterableArrayconsteffect/Channel.ts:1718
<A, D, E>(
  iterable: AsyncIterable<A, D>,
  onError: (error: unknown) => E
): Channel<Arr.NonEmptyReadonlyArray<A>, E, D>

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.

constructors
export const fromAsyncIterableArray = <A, D, E>(
  iterable: AsyncIterable<A, D>,
  onError: (error: unknown) => E
): Channel<Arr.NonEmptyReadonlyArray<A>, E, D> => map(fromAsyncIterable(iterable, onError), Arr.of)
Referenced by 1 symbols