<A>(self: ScopedRef<A>): Effect.Effect<A>Retrieves the current value of the scoped reference effectfully.
When to use
Use to read the value currently stored in a ScopedRef inside an Effect
workflow.
export const const get: <A>(
self: ScopedRef<A>
) => Effect.Effect<A>
Retrieves the current value of the scoped reference effectfully.
When to use
Use to read the value currently stored in a ScopedRef inside an Effect
workflow.
get = <function (type parameter) A in <A>(self: ScopedRef<A>): Effect.Effect<A>A>(self: ScopedRef<A>(parameter) self: {
backing: Synchronized.SynchronizedRef<readonly [Scope.Closeable, 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 ScopedRef<in out A>A ScopedRef is a reference whose value is associated with resources,
which must be released properly. You can both get the current value of any
ScopedRef, as well as set it to a new value (which may require new
resources). The reference itself takes care of properly releasing resources
for the old value whenever a new value is obtained.
When to use
Use when an application needs to keep a current resource-backed value and
later replace it with another acquired value while ensuring the previous
value is released.
ScopedRef<function (type parameter) A in <A>(self: ScopedRef<A>): Effect.Effect<A>A>): import EffectEffect.type Effect.Effect = /*unresolved*/ anyEffect<function (type parameter) A in <A>(self: ScopedRef<A>): Effect.Effect<A>A> => import EffectEffect.sync(() => const getUnsafe: <A>(
self: ScopedRef<A>
) => A
Retrieves the current value of the scoped reference synchronously.
When to use
Use when you need immediate synchronous access to the current ScopedRef
value and can guarantee that reading outside the Effect API is safe.
getUnsafe(self: ScopedRef<A>(parameter) self: {
backing: Synchronized.SynchronizedRef<readonly [Scope.Closeable, 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))