fromTimer()
Create a timer source with the fromTimer source factory.
Import
Section titled “Import”import { fromTimer } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function fromTimer( ms: number, opts?: TimerSourceOpts,): Operator<never, number>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
ms | number | Delay before the first tick in milliseconds. |
opts | TimerSourceOpts | Optional period and source options. |
Returns
Section titled “Returns”A source operator that emits tick counters.
Example
Section titled “Example”import { graph } from "@graphrefly/ts/graph";import { fromTimer } from "@graphrefly/ts/sources";
const tick = graph().initNode(fromTimer(100), []);Remarks
Section titled “Remarks”- Factory name: This preserves the real
fromTimerfactory name indescribe().
Source
Section titled “Source”packages/ts/src/graph/sources.ts