<A>(self: SynchronizedRef<A>): AReads 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.
export const 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 = <function (type parameter) A in <A>(self: SynchronizedRef<A>): AA>(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>): AA>): function (type parameter) A in <A>(self: SynchronizedRef<A>): AA => 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.SynchronizedRef<in out A>.backing: Ref.Ref<A>(property) SynchronizedRef<in out A>.backing: {
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; <…;
}
backing.ref.current