Package: effect
Module: SynchronizedRef
Runs an effectful update atomically while holding the ref’s semaphore, sets the new value if the effect succeeds, and returns the previous value.
When to use
Use when you need an effectful SynchronizedRef state transition to return
the previous stored value.
See
getAndUpdate for pure updates that return the previous valueupdateEffect for effectful updates without returning a valueupdateAndGetEffect for effectful updates that return the new valuemodifyEffect for effectful updates with a custom return valuegetAndUpdateSomeEffect for conditional effectful updates that return the previous valueSignature
declare const getAndUpdateEffect: { <A, R, E>(f: (a: A) => Effect.Effect<A, E, R>): (self: SynchronizedRef<A>) => Effect.Effect<A, E, R>; <A, R, E>(self: SynchronizedRef<A>, f: (a: A) => Effect.Effect<A, E, R>): Effect.Effect<A, E, R>; }
Since v2.0.0