variable / @typed/fx

RefGraph.findNode

Find a node matching a predicate.

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

Import

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

Access RefGraph.findNode through the imported RefGraph 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 const findNode: {
    <N>(predicate: (data: N) => boolean): <E, T extends Graph.Kind, Err, R>(ref: RefGraph<N, E, T, Err, R>) => RefSubject.Filtered<Graph.NodeIndex, Err, R>;
    <N, E, T extends Graph.Kind, Err, R>(ref: RefGraph<N, E, T, Err, R>, predicate: (data: N) => boolean): RefSubject.Filtered<Graph.NodeIndex, Err, R>;
};

Why

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

Ownership and lifetime

The find node 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