import { AsyncReducer } from "https://deno.land/x/rimbu@0.13.0/common/internal.ts";
const { combineArr } = AsyncReducer;
Returns an AsyncReducer
that combines multiple input reducers
by providing input values to all of them and collecting the outputs in an array.
Examples
Example 1
Example 1
const red = AsyncReducer.combineArr(AsyncReducer.sum, AsyncReducer.average)
await AsyncStream.from(Stream.range({ amount: 9 }))
.reduce(red)
// => [36, 4]
Parameters
...reducers: [K in keyof R]: AsyncReducer<T, R[K]> & AsyncReducer<T, unknown>[]
- 2 or more reducers to combine