Skip to main content

Function: toSet()

toSet<Value>(): Reducer<Value, Set<Value>>

Returns a Reducer that collects values to a Set.

Type Parameters

Value

Returns

Reducer<Value, Set<Value>>

Example

console.log(
pipe(
cycle([`sloth`, `more sloth`]),
take(4),
reduce(toArray()),
),
)
//=> Set(2) { 'sloth', 'more sloth' }

Defined in

collections.d.ts:49