import { AsyncReducer } from "https://deno.land/x/rimbu@0.13.0/common/internal.ts";
const { toJSSet } = AsyncReducer;
Returns an AsyncReducer
that collects received input values into a mutable JS Set, and returns
a copy of that map when output is requested.
Examples
Example 1
Example 1
await AsyncStream.of(1, 2, 3).reduce(AsyncReducer.toJSSet()))
// Set {1, 2, 3}
Returns
AsyncReducer<T, Set<T>>