Package: effect
Module: SynchronizedRef
Runs an effectful modification atomically while holding the ref’s semaphore, stores the new value if the effect succeeds, and returns the computed result.
When to use
Use to effectfully compute both a separate return value and the next stored
SynchronizedRef value in one serialized update.
See
modify for the pure variantupdateEffect for effectfully storing a new value without a separate resultSignature
declare const modifyEffect: { <A, B, E, R>(f: (a: A) => Effect.Effect<readonly [B, A], E, R>): (self: SynchronizedRef<A>) => Effect.Effect<B, E, R>; <A, B, E, R>(self: SynchronizedRef<A>, f: (a: A) => Effect.Effect<readonly [B, A], E, R>): Effect.Effect<B, E, R>; }
Since v2.0.0