interface / @typed/template

Many

A collection source, stable key function, and per-item view supplied to a renderer. Describing the collection acquires nothing; the active target owns subscription and child lifetimes.

The DOM target retains each key’s subject and scope across moves. The HTML target consumes an initial collection for finite response output. Construct descriptors with many rather than assembling this protocol by hand.

Package version
1.0.0-beta.7
Category
Keyed collection rendering
Since
1.0.0

Import

import { Many } from "@typed/template";

Signatures

export interface Many<A, E, R> {
    readonly [ManyTypeId]: ManyTypeId;
    readonly values: Fx.Fx<ReadonlyArray<A>, E, R>;
    readonly getKey: (value: A) => PropertyKey;
    readonly render: (value: RefSubject.RefSubject<A>, key: PropertyKey) => Fx.Fx<RenderEvent, E, R>;
}

Property: [[computed:[ManyTypeId]]]

Descriptor recognition.

Property: getKey

Identity independent of array position.

Property: render

Renders a retained item through its live subject.

Property: values

Current ordered records and later collection changes.

Other public imports

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

Source