effect-io-ai

Package: effect
Module: Combiner

Combiner.last

Creates a Combiner that always returns the last (right) argument.

When to use

Use when you want “last write wins” semantics while merging values.

Details

combine(self, that) returns that and ignores self.

Example (Keeping the last value)

import { Combiner } from "effect"

const Last = Combiner.last<number>()

console.log(Last.combine(1, 2))
// Output: 2

See

Signature

declare const last: <A>() => Combiner<A>

Source

Since v4.0.0