API reference › @evolu/common › Schedule › sequenceSchedules
function sequenceSchedules<Output, Input>(
...schedules: readonly Schedule<Output, Input>[]
): Schedule<Output, Input>;
Defined in: packages/common/src/Schedule.ts:1801
Sequences schedules: runs each until it stops, then continues with the next.
Useful for adaptive strategies that start aggressive and become more conservative over time.
Sequencing strategies
import {
assertOk,
exponential,
fixed,
sequenceSchedules,
take,
testCreateDeps,
} from "@evolu/common";
// Fast retries first, then slower retries, then a steady fallback.
const step = sequenceSchedules(
take(3)(exponential("100ms")),
take(5)(fixed("500ms")),
fixed("1s"),
)(testCreateDeps());
step(undefined);
step(undefined);
step(undefined);
assertOk(step(undefined), [0, 500]);