Examples
Small, inspectable starts.
Examples should teach the package from actual TypeScript imports and graph behavior, not from shared marketing copy.
State and derived values
import { graph } from "@graphrefly/ts/graph";
const g = graph();
const count = g.state(0);
const doubled = g.derived([count], ([n]) => n * 2);Graph APIOperators
import { map, distinctUntilChanged } from "@graphrefly/ts/operators";
const normalized = source.pipe(
map((value) => value.trim()),
distinctUntilChanged(),
);Operator APISources
import { fromWebSocket } from "@graphrefly/ts/sources";
const events = fromWebSocket("wss://example.test/events");Sources API