interface / @typed/fx

RefSubject.GetSetDelete

Interface for basic RefSubject operations: get, set, delete.

Package version
2.0.0-beta.7
Category
Transactions
Since
1.0.0
Member of
RefSubject

Import

import { RefSubject } from "@typed/fx";

Access RefSubject.GetSetDelete through the imported RefSubject export. Its declaration below describes the member.

This public exposure is a re-export. Its import path is supported; declaration documentation is shared with the other public exposures below.

Signatures

export interface GetSetDelete<A, E = never, R = never> {
    readonly get: Effect.Effect<A, E, R>;
    readonly set: (a: A) => Effect.Effect<A, E, R>;
    readonly delete: Effect.Effect<Option.Option<A>, E, R>;
}

Why

Interface for basic RefSubject operations: get, set, delete.

Ownership and lifetime

GetSetDelete is a contract and performs no acquisition. Implementations retain the errors, services, interruption, and Scope requirements expressed by its members.

Property: delete

Removes and returns the value visible to the current transaction.

Property: delete: Why

Removes the value from the current transaction and returns the previous value as Some, or None when no value was present.

Property: delete: Ownership and lifetime

Running delete performs one serialized subject transition and returns the committed value. It acquires no resource and preserves source failures and services.

Property: get

Reads the value visible to the current transaction.

Property: get: Why

Reads the value visible inside the current transaction without publishing a change.

Property: get: Ownership and lifetime

Running get performs no mutation or acquisition. It can fail with E and requires R; when used by updates, it observes that transaction’s buffered value.

Property: set

Replaces the value inside the current transaction.

Property: set: Why

The transition is serialized at the RefSubject rather than coordinated by callers or UI components.

Property: set: Ownership and lifetime

Running set performs one serialized subject transition and returns the committed value. It acquires no resource and preserves source failures and services.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source