GraphReFlyTS

API Reference

interval()

Emit periodic tick counters.

Import

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

Signature

function interval(ms: number): Operator<never, number>

Parameters

ParameterTypeDescription
msnumberDelay before the first tick and between later ticks in milliseconds.

Returns

A source operator that emits 0, 1, 2, and so on.

Example

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

const ticks = graph().initNode(interval(1000), []);

Source

packages/ts/src/graph/sources.ts