Hyperlinkv0.8.0-beta.28

Channel

Channel.fromIterableArrayconsteffect/Channel.ts:797
<A, L>(iterable: Iterable<A, L>, chunkSize?: number): Channel<
  Arr.NonEmptyReadonlyArray<A>,
  never,
  L
>

Creates a Channel that emits arrays of elements from an iterable.

Example (Batching iterable output)

import { Channel } from "effect"

const numbers = [1, 2, 3, 4, 5]
const channel = Channel.fromIterableArray(numbers)
// Emits arrays like: [1, 2, 3, 4], [5] (based on chunk size)
constructors
Source effect/Channel.ts:7974 lines
export const fromIterableArray = <A, L>(
  iterable: Iterable<A, L>,
  chunkSize = DefaultChunkSize
): Channel<Arr.NonEmptyReadonlyArray<A>, never, L> => fromIteratorArray(() => iterable[Symbol.iterator](), chunkSize)
Referenced by 1 symbols