effect-io-ai

Package: effect
Module: SynchronizedRef

SynchronizedRef.updateSomeAndGetEffect

Runs an effectful partial update while holding the ref’s semaphore 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 run an effectful conditional SynchronizedRef update and return the resulting current value.

See

Signature

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

Source

Since v2.0.0