pipe()
Compose unary operator factories into a graph-registered chain.
Import
Section titled “Import”import { pipe } from "@graphrefly/ts/composition";Signature
Section titled “Signature”function pipe( g: Graph, source: Node<unknown>, ...ops: readonly PipeOperator<unknown, unknown>[],): Node<unknown>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
g | Graph | Graph that owns the registered operator nodes. |
source | Node<unknown> | Upstream node to start from. |
ops | readonly PipeOperator<unknown, unknown>[] | Unary operator factories to apply in order. |
Returns
Section titled “Returns”The node produced by the last operator in the chain.
Example
Section titled “Example”const doubled = pipe(g, source, map((value: number) => value * 2));Source
Section titled “Source”packages/ts/src/graph/composition.ts