Package: effect
Module: SubscriptionRef
Retrieves the current value of the SubscriptionRef unsafely.
When to use
Use when you are in synchronous internals or test setup where concurrent updates are controlled.
Gotchas
This function directly accesses the underlying reference without any synchronization. It should only be used when you are certain there are no concurrent modifications.
Example (Reading the current value unsafely)
import { Effect, SubscriptionRef } from "effect"
const program = Effect.gen(function*() {
const ref = yield* SubscriptionRef.make(42)
const value = SubscriptionRef.getUnsafe(ref)
console.log(value)
})
Signature
declare const getUnsafe: <A>(self: SubscriptionRef<A>) => A
Since v4.0.0