GraphReFlyTS

API Reference

take()

Emit the first n upstream values, then complete.

Import

import { take } from "@graphrefly/ts/operators";

Signature

function take(n: number): Operator<S, S>

Parameters

ParameterTypeDescription
nnumberNumber of DATA values to pass before completion.

Returns

An operator that forwards at most n values and then emits COMPLETE.

Example

import { graph } from "@graphrefly/ts/graph";
import { take } from "@graphrefly/ts/operators";

const firstThree = graph().initNode(take<number>(3), [source]);

Source

packages/ts/src/graph/operators.ts