function / @typed/fx/Versioned

transform

Transforms a Versioned value into another Versioned value.

Package version
2.0.0-beta.13
Category
Channel transformations
Since
1.0.0

Import

import { transform } from "@typed/fx/Versioned";

Signatures

export declare function transform<R0, E0, A, E, R, B, E2, R2, C, E3, R3, D, E4, R4>(input: Versioned<R0, E0, A, E, R, B, E2, R2>, transformFx: (fx: Fx.Fx<A, E, R>) => Fx.Fx<C, E3, R3>, transformGet: (effect: Effect.Effect<B, E2, R2>) => Effect.Effect<D, E4, R4>): Versioned<never, never, C, E3, R3, D, E0 | E4, R0 | R4>;

Why

Transforms the pushed and sampled channels together while retaining one version source, so both ways of consuming the value stay coherent.

Ownership and lifetime

transform does not take ownership of its inputs. Its observation and current-read channels retain upstream lifetime, typed failures, services, and interruption behavior. Sampled projections and in-flight reads are cached separately for each Effect Context object. Interrupting a transformed value affects the current Context’s in-flight read.

Other public imports

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

Source