effect-io-ai

Package: effect
Module: SynchronizedRef

SynchronizedRef.updateAndGet

Updates the value of the SynchronizedRef with a function and returns the new value.

When to use

Use to apply a pure SynchronizedRef state transition and return the new stored value.

See

Signature

declare const updateAndGet: { <A>(f: (a: A) => A): (self: SynchronizedRef<A>) => Effect.Effect<A>; <A>(self: SynchronizedRef<A>, f: (a: A) => A): Effect.Effect<A>; }

Source

Since v2.0.0