interface / @typed/fx/RefSubject

RefSubject.Class

Defines the class state contract.

Package version
2.0.0-beta.7
Category
Services
Since
1.18.0
Member of
RefSubject

Import

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

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

Signatures

interface Class<Self, Id extends string, A, E> extends RefSubject.Service<Self, Id, A, E> {
    new (): RefSubject.Service<Self, Id, A, E>;
}

Why

Adds the construct signature used by class-extension syntax to the RefSubject service facade.

Ownership and lifetime

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

Construct signatures

Construct signature used by the generated RefSubject service class.

Construct signatures: Why

Makes class State extends RefSubject.Service(...)(id) {} type-check while returning the static facade rather than allocating a second state object.

Construct signatures: Ownership and lifetime

Constructing the generated class returns its static service facade; it does not allocate or acquire a RefSubject. The matching Layer owns the installed state and its Scope.

Other public imports

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

Source