effect-io-ai

Package: effect
Module: Sink

Sink.collectAllToMapN

A sink that collects first n keys into a map. The keys are calculated from inputs using the keying function key; if multiple inputs use the the same key, they are merged using the merge function.

Signature

declare const collectAllToMapN: <In, K>(n: number, key: (input: In) => K, merge: (x: In, y: In) => In) => Sink<HashMap.HashMap<K, In>, In, In>

Source

Since v2.0.0