Package: effect
Module: TxSubscriptionRef
Creates a new TxSubscriptionRef with the specified initial value.
When to use
Use to create a TxSubscriptionRef that publishes every committed update to
subscribers.
Example (Creating a transactional subscription reference)
import { Effect, TxSubscriptionRef } from "effect"
const program = Effect.gen(function*() {
const ref = yield* TxSubscriptionRef.make(42)
const value = yield* TxSubscriptionRef.get(ref)
console.log(value) // 42
})
See
changes for subscribing to the created referenceSignature
declare const make: <A>(value: A) => Effect.Effect<TxSubscriptionRef<A>>
Since v3.10.0