GraphReFlyTS

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

ParameterTypeDescription
exprstringFive-field cron expression.
optsFromCronOptionsCron 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