API Reference
Graph
Own a single graph-local topology, lifecycle, inspection index, and dispatcher boundary.
Import
import { Graph } from "@graphrefly/ts/graph";
Signature
class Graph
Example
import { graph } from "@graphrefly/ts/graph";
const g = graph({ name: "counter" });
const count = g.state(0, { name: "count" });
const doubled = g.derived([count], ([value]) => value * 2, { name: "doubled" });
Remarks
- Graph-local: Cross-graph dependencies require a wire bridge; direct deps stay inside one graph ownership domain.
Source
packages/ts/src/graph/graph.ts