function / @typed/fx/Versioned

struct

Combines multiple Versioned values into a single struct.

Package version
2.0.0-beta.7
Category
State composition
Since
1.0.0

Import

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

Signatures

export declare function struct<const VS extends Readonly<Record<string, Versioned<any, any, any, any, any, any, any, any>>>>(versioneds: VS): Versioned<Versioned.VersionContext<VS[keyof VS]>, Versioned.VersionError<VS[keyof VS]>, {
    readonly [K in keyof VS]: Fx.Success<VS[K]>;
}, Fx.Error<VS[keyof VS]>, Fx.Services<VS[keyof VS]>, {
    readonly [K in keyof VS]: Effect.Success<VS[K]>;
}, Effect.Error<VS[keyof VS]>, Effect.Services<VS[keyof VS]>>;

Why

Combines named Versioned values and preserves each field’s pushed value, sampled value, errors, and services in the resulting structure.

Ownership and lifetime

struct does not take ownership of its inputs. Its observation and current-read channels retain upstream lifetime, typed failures, services, and interruption behavior.

Other public imports

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

Source