<A>(self: SynchronizedRef<A>): Effect.Effect<A>Returns an Effect that reads the current value of the SynchronizedRef.
When to use
Use to read the current value of a SynchronizedRef inside an Effect
program without changing it.
export const const get: <A>(
self: SynchronizedRef<A>
) => Effect.Effect<A>
Returns an Effect that reads the current value of the SynchronizedRef.
When to use
Use to read the current value of a SynchronizedRef inside an Effect
program without changing it.
get = <function (type parameter) A in <A>(self: SynchronizedRef<A>): Effect.Effect<A>A>(self: SynchronizedRef<A>(parameter) self: {
backing: Ref.Ref<A>;
semaphore: Semaphore.Semaphore;
ref: MutableRef.MutableRef<A>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self: interface SynchronizedRef<in out A>A mutable reference whose update and modify operations are serialized with an
internal semaphore, including effectful transformations.
When to use
Use when shared state may be updated by multiple fibers and each update,
including effectful state transitions, must observe one current value and run
one at a time.
SynchronizedRef<function (type parameter) A in <A>(self: SynchronizedRef<A>): Effect.Effect<A>A>): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<function (type parameter) A in <A>(self: SynchronizedRef<A>): Effect.Effect<A>A> => import EffectEffect.sync(() => const getUnsafe: <A>(
self: SynchronizedRef<A>
) => A
Reads the current value synchronously, bypassing the Effect API and the
ref's semaphore.
When to use
Use when you need immediate synchronous access to a SynchronizedRef value
in low-level code that can safely read outside an Effect.
getUnsafe(self: SynchronizedRef<A>(parameter) self: {
backing: Ref.Ref<A>;
semaphore: Semaphore.Semaphore;
ref: MutableRef.MutableRef<A>;
pipe: { <A>(this: A): A; <A, B = never>(this: A, ab: (_: A) => B): B; <A, B = never, C = never>(this: A, ab: (_: A) => B, bc: (_: B) => C): C; <A, B = never, C = never, D = never>(this: A, ab: (_: A) => B, bc: (_: B) => C, cd: (_: C) => D): D; <…;
}
self))