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

x/rimbu/common/internal.ts>Reducer.toJSSet

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
function Reducer.toJSSet
import { Reducer } from "https://deno.land/x/rimbu@0.13.1/common/internal.ts";
const { toJSSet } = Reducer;

Returns a Reducer that collects received input values into a mutable JS Set, and returns a copy of that map when output is requested.

Examples

Example 1

console.log(Stream.of(1, 2, 3).reduce(Reducer.toJSSet()))
// Set {1, 2, 3}