Graph
Own a single graph-local topology, lifecycle, inspection index, and dispatcher boundary.
Import
Section titled “Import”import { Graph } from "@graphrefly/ts/graph";Signature
Section titled “Signature”class GraphExample
Section titled “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
Section titled “Remarks”- Graph-local: Cross-graph dependencies require a wire bridge; direct deps stay inside one graph ownership domain.
Source
Section titled “Source”packages/ts/src/graph/graph.ts