variable / @typed/fx/RefArray

getIndex

Get a value contained a particular index of a RefArray.

Package version
2.0.0-beta.13
Category
Optional queries
Since
1.18.0

Import

import { getIndex } from "@typed/fx/RefArray";

Signatures

export declare const getIndex: {
    (index: number): <A, E, R>(ref: RefArray<A, E, R>) => RefSubject.Filtered<A, E, R>;
    <A, E, R>(ref: RefArray<A, E, R>, index: number): RefSubject.Filtered<A, E, R>;
};

Why

Models the possibly absent result of get index as Filtered state, so absence stays explicit while later source versions can make a value available.

Ownership and lifetime

The get index view retains no independent value. Its Effect read fails with NoSuchElement while absent; the observing Scope owns and finalizes its Fx subscription.

Other public imports

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

Source