Package: effect
Module: SynchronizedRef
Sets a new value atomically and returns the previous value, serialized by the ref’s semaphore.
When to use
Use to replace a SynchronizedRef with a known value when the previous value
is also needed.
See
set for setting a value without returning the previous valuesetAndGet for setting a value and returning the new valuegetAndUpdate for deriving the new value from the current valueSignature
declare const getAndSet: { <A>(value: A): (self: SynchronizedRef<A>) => Effect.Effect<A>; <A>(self: SynchronizedRef<A>, value: A): Effect.Effect<A>; }
Since v2.0.0