Skip to content
PACKAGES

take()

Emit the first n upstream values, then complete.

import { take } from "@graphrefly/ts/operators";
function take(n: number): Operator<S, S>
ParameterTypeDescription
nnumberNumber of DATA values to pass before completion.

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

import { graph } from "@graphrefly/ts/graph";
import { take } from "@graphrefly/ts/operators";
const firstThree = graph().initNode(take<number>(3), [source]);

packages/ts/src/graph/operators.ts