effect-io-ai

Package: effect
Module: SynchronizedRef

SynchronizedRef.updateSomeEffect

Runs an effectful partial update while holding the ref’s semaphore. Option.some stores the new value; Option.none leaves the ref unchanged.

When to use

Use to run an effectful conditional SynchronizedRef update without returning a value.

See

Signature

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

Source

Since v2.0.0