API reference › @evolu/common › Schedule › fibonacci
function fibonacci(
initial: Duration,
): Schedule<
number &
Brand<"Int"> &
Brand<"NonNegative"> &
Brand<"LessThan281474976710655"> &
Brand<"Millis">
>;
Defined in: packages/common/src/Schedule.ts:308
Fibonacci backoff schedule.
Delays follow the Fibonacci sequence, growing more slowly than exponential:
- Attempt 1:
initial - Attempt 2:
initial - Attempt 3:
initial * 2 - Attempt 4:
initial * 3 - Attempt 5:
initial * 5 - ...
Never stops — combine with take or maxElapsed to limit.
Example
// 100ms, 100ms, 200ms, 300ms, 500ms, 800ms, ...
const fib = fibonacci("100ms");