GraphReFlyTS

API Reference

fromTimer()

Create a timer source with the fromTimer source factory.

Import

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

Signature

function fromTimer(
	ms: number,
	opts?: TimerSourceOpts,
): Operator<never, number>

Parameters

ParameterTypeDescription
msnumberDelay before the first tick in milliseconds.
optsTimerSourceOptsOptional period and source options.

Returns

A source operator that emits tick counters.

Example

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

const tick = graph().initNode(fromTimer(100), []);

Remarks

  • Factory name: This preserves the real fromTimer factory name in describe().

Source

packages/ts/src/graph/sources.ts