API reference › @evolu/common › Task › RepeatOptions

Defined in: packages/common/src/Task.ts:4241

Options for repeat.

Properties

onRepeat?

readonly onRepeat?: (attempt: RepeatAttempt<T, Output>) => void;

Defined in: packages/common/src/Task.ts:4259

Runs before each scheduled repeat.

attempt is the completed attempt that caused this repeat, not the upcoming attempt number. The callback runs after RepeatOptions.shouldRepeat and the Schedule approve a repeat, and before the repeat delay. The callback must not throw: a thrown exception is a defect that panics the Run tree.


shouldRepeat?

readonly shouldRepeat?: Predicate<T>;

Defined in: packages/common/src/Task.ts:4248

Decides whether an Ok value should schedule another repeat.

The predicate must not throw: a thrown exception is a defect that panics the Run tree.