Variable: toWeakSet()
consttoWeakSet: <Value>() =>Reducer<Value,WeakSet<Value>>
Defined in: collections.d.ts:82
Returns a Reducer that collects objects to a WeakSet.
Type Parameters
Value
Value extends object
Returns
Reducer<Value, WeakSet<Value>>
Example
import { cycle, map, pipe, reduce, take, toWeakSet } from 'lfi'
console.log(
pipe(
cycle([`sloth`, `lazy`, `sleep`]),
take(4),
map(word => ({ sloth: word })),
reduce(toWeakSet()),
),
)
//=> WeakSet { <items unknown> }
Since
v0.0.1