effect-io-ai

Package: effect
Module: SynchronizedRef

SynchronizedRef.updateSomeAndGet

Applies a partial update and returns the resulting current value. Option.some stores and returns the new value; Option.none returns the unchanged value.

When to use

Use to apply a pure conditional SynchronizedRef update and return the resulting current value.

See

Signature

declare const updateSomeAndGet: { <A>(pf: (a: A) => Option.Option<A>): (self: SynchronizedRef<A>) => Effect.Effect<A>; <A>(self: SynchronizedRef<A>, pf: (a: A) => Option.Option<A>): Effect.Effect<A>; }

Source

Since v2.0.0