Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/main/exports.ts>AsyncReducer.toJSSet

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function AsyncReducer.toJSSet
import { AsyncReducer } from "https://deno.land/x/rimbu@1.0.3/core/main/exports.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

await AsyncStream.of(1, 2, 3).reduce(AsyncReducer.toJSSet()))
// Set {1, 2, 3}