of()
of: synchronous values — each argument as DATA, then COMPLETE. of() is the EMPTY source.
Import
Section titled “Import”import { of } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function of(...values: T[]): Operator<never, T>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
values | T[] | Values to emit synchronously on activation. |
Returns
Section titled “Returns”A source operator that emits each value and then COMPLETE.
Example
Section titled “Example”import { graph } from "@graphrefly/ts/graph";import { of } from "@graphrefly/ts/sources";
const values = graph().initNode(of(1, 2, 3), []);Source
Section titled “Source”packages/ts/src/graph/sources.ts