UNPKG

@geersch/retry

Version:

Backoff strategies to use when retrying a function after a given delay.

14 lines 374 B
export class LinearBackoffStrategy { baseDelay; constructor({ baseDelay = 100 } = {}) { this.baseDelay = baseDelay; } *getGenerator(maxRetries) { let attempt = 1; while (attempt <= maxRetries) { yield this.baseDelay * attempt; attempt += 1; } } } //# sourceMappingURL=linear.backoff-strategy.js.map