API reference › @evolu/common › Schedule › spaced
function spaced(
duration: Duration,
): Schedule<
number &
Brand<"Int"> &
Brand<"NonNegative"> &
Brand<"LessThan281474976710655"> &
Brand<"Millis">
>;
Defined in: packages/common/src/Schedule.ts:208
Constant delay schedule.
Always waits the same duration after each execution completes. Never stops — combine with take or maxElapsed to limit.
Example
// 1s, 1s, 1s, ... (polling)
const poll = spaced("1s");
// Retry 3 times with 500ms between each
const retry = take(3)(spaced("500ms"));
// Heartbeat schedule
const heartbeat = spaced("30s");