dynamicNode()
Construct a dynamicNode (R-dynamic-node / D35) — a node variant whose fn reads a
subset of a fixed superset of deps per invocation via ctx.track(i). All declared
deps participate in wave tracking; an unread dep’s change re-runs the fn, which re-emits
its current value as DATA (D49 removed equals-absorption — dedup is opt-in via
distinctUntilChanged). Intra-graph only (D22).
Import
Section titled “Import”import { dynamicNode } from "@graphrefly/ts/core";Signature
Section titled “Signature”function dynamicNode( deps: Node<unknown>[], fn: NodeFn, opts: NodeOptions<T> = {},): Node<T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
deps | Node<unknown>[] | Declared dependency node or nodes. |
fn | NodeFn | Synchronous function invoked by the helper. |
opts | NodeOptions<T> | Options that configure the helper. |
Returns
Section titled “Returns”A Node<T> value.
Example
Section titled “Example”import { dynamicNode } from "@graphrefly/ts/core";Source
Section titled “Source”packages/ts/src/node/node.ts