Package: effect
Module: Ref
Gets the current value of the Ref.
When to use
Use to read the current Ref value without changing it.
Example (Getting the current value)
import { Effect, Ref } from "effect"
const program = Effect.gen(function*() {
const ref = yield* Ref.make(42)
const value = yield* Ref.get(ref)
console.log(value) // 42
})
See
set for replacing the current valueSignature
declare const get: <A>(self: Ref<A>) => Effect.Effect<A, never, never>
Since v2.0.0