import { AsyncReducer } from "https://deno.land/x/rimbu@1.0.3/core/main/exports.ts";
const { toArray } = AsyncReducer;
Returns an AsyncReducer
that collects received input values in an array, and returns a copy of that array as an output value when requested.
Examples
Example 1
Example 1
await AsyncStream.of(1, 2, 3).reduce(AsyncReducer.toArray()))
// => [1, 2, 3]
Returns
AsyncReducer<T, T[]>