effect-io-ai

Package: effect
Module: SynchronizedRef

SynchronizedRef.modifySome

Computes a return value and an optional new ref value atomically. Option.some updates the ref; Option.none leaves it unchanged.

When to use

Use to compute a return value while optionally updating a SynchronizedRef under its semaphore.

See

Signature

declare const modifySome: { <B, A>(pf: (a: A) => readonly [B, Option.Option<A>]): (self: SynchronizedRef<A>) => Effect.Effect<B>; <A, B>(self: SynchronizedRef<A>, pf: (a: A) => readonly [B, Option.Option<A>]): Effect.Effect<B>; }

Source

Since v2.0.0