effect-io-ai

Package: effect
Module: Record

Record.makeReducerIntersection

Creates a Reducer whose combine operation intersects two records and combines values for keys present in both records.

When to use

Use to build a Reducer that combines records by retaining only keys shared by both inputs and combining matching values with a Combiner.

Gotchas

The reducer’s initialValue is an empty record. Because intersection with an empty record is empty, the default combineAll folds from {} and therefore produces {} for ordinary non-empty inputs.

See

Signature

declare const makeReducerIntersection: <K extends string, A>(combiner: Combiner.Combiner<A>) => Reducer.Reducer<Record<K, A>>

Source

Since v4.0.0