fromCron()
Emit wall-clock cron ticks on a graph source.
Import
Section titled “Import”import { fromCron } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function fromCron( expr: string, opts: FromCronOptions = {},): Operator<never, Date | number | string>Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
expr | string | Five-field cron expression. |
opts | FromCronOptions | Cron polling, timezone, DST, abort, and output-shape options. |
Returns
Section titled “Returns”A source operator that emits the current time when the schedule matches.
Example
Section titled “Example”import { graph } from "@graphrefly/ts/graph";import { fromCron } from "@graphrefly/ts/sources";
const everyMinute = graph().initNode(fromCron("0 * * * *"), []);Source
Section titled “Source”packages/ts/src/graph/sources.ts