API Reference
subscribeNodeValues()
Subscribe to DATA values from a Node. Protocol internals stay below the adapter boundary: DATA drives value listeners, ERROR/COMPLETE route to optional lifecycle callbacks.
Import
import { subscribeNodeValues } from "@graphrefly/ts/adapters";
Signature
function subscribeNodeValues(
node: Node<T>,
run: (value: T | undefined) => void,
opts: SubscribeValuesOptions<T> = {},
): () => void
Parameters
| Parameter | Type | Description |
|---|---|---|
node | Node<T> | Node to observe, adapt, or connect. |
run | (value: T | undefined) => void | run value used by the helper. |
opts | SubscribeValuesOptions<T> | Options that configure the helper. |
Returns
A () => void value.
Example
import { subscribeNodeValues } from "@graphrefly/ts/adapters";
Source
packages/ts/src/adapters/store.ts