GraphReFlyTS

API Reference

fromIter()

Emit every value from a synchronous iterable.

Import

import { fromIter } from "@graphrefly/ts/sources";

Signature

function fromIter(iterable: Iterable<T>): Operator<never, T>

Parameters

ParameterTypeDescription
iterableIterable<T>Iterable whose values are emitted in order.

Returns

A source operator that emits every iterable value and then COMPLETE.

Example

import { graph } from "@graphrefly/ts/graph";
import { fromIter } from "@graphrefly/ts/sources";

const values = graph().initNode(fromIter([1, 2, 3]), []);

Source

packages/ts/src/graph/sources.ts