effect-io-ai

Package: effect
Module: TxSubscriptionRef

TxSubscriptionRef.get

Reads the current value of the TxSubscriptionRef.

When to use

Use to read the current TxSubscriptionRef value without subscribing to future changes.

Example (Reading the current value)

import { Effect, TxSubscriptionRef } from "effect"

const program = Effect.gen(function*() {
  const ref = yield* TxSubscriptionRef.make("hello")
  const value = yield* TxSubscriptionRef.get(ref)
  console.log(value) // "hello"
})

See

Signature

declare const get: <A>(self: TxSubscriptionRef<A>) => Effect.Effect<A>

Source

Since v3.10.0