effect-io-ai

Package: effect
Module: TSubscriptionRef

TSubscriptionRef.TSubscriptionRef

A TSubscriptionRef<A> is a TRef that can be subscribed to in order to receive a TDequeue<A> of the current value and all committed changes to the value.

Signature

export interface TSubscriptionRef<in out A> extends TSubscriptionRef.Variance<A>, TRef.TRef<A> {
  /** @internal */
  readonly ref: TRef.TRef<A>
  /** @internal */
  readonly pubsub: TPubSub.TPubSub<A>
  /** @internal */
  modify<B>(f: (a: A) => readonly [B, A]): STM.STM<B>

  /**
   * A TDequeue containing the current value of the `Ref` as well as all changes
   * to that value.
   */
  readonly changes: STM.STM<TQueue.TDequeue<A>>
}

Source

Since v3.10.0