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

x/rimbu/core/main/index.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.5/core/main/index.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}