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