GraphReFlyTS

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

ParameterTypeDescription
nodeNode<T>Node to observe, adapt, or connect.
run(value: T | undefined) => voidrun value used by the helper.
optsSubscribeValuesOptions<T>Options that configure the helper.

Returns

A () => void value.

Example

import { subscribeNodeValues } from "@graphrefly/ts/adapters";

Source

packages/ts/src/adapters/store.ts