function / @typed/fx

RefSubject.computedFromService

Lifts an Effect-provided Computed into a Computed facade.

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

Import

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

Access RefSubject.computedFromService 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 declare function computedFromService<R, A, E, R2>(effect: Effect.Effect<Computed<A, E, R2>, never, R>): Computed<A, E, R | R2>;

Why

Defers service lookup until each version read, current read, interruption, or Fx observation, so callers can compose a Context-provided Computed without manually flat-mapping the service Effect.

Ownership and lifetime

The facade caches neither the resolved Computed nor its value. Each operation runs the supplied Effect, then delegates to the resolved Computed. Service requirements combine as R | R2, source failures remain E, and the observing Scope owns the delegated subscription.

Other public imports

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

Source