Skip to content

Commit

Permalink
feat: make JitterOptions entirely optional
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmaric committed Sep 3, 2024
1 parent 8b3195e commit e3bcac0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/policies/Jitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export type JitterOptions = {
* Randomizes the delay between retries by adding or removing a random amount of
* time to the delay provided by the next policy in the chain.
*/
export const Jitter = (options: JitterOptions): RetryPolicy => {
const range = options.range ?? -0.5
const offset = options.offset ?? 0.25
export const Jitter = (options?: JitterOptions): RetryPolicy => {
const range = options?.range ?? -0.5
const offset = options?.offset ?? 0.25

return (state, next) => {
if (!next) {
Expand Down

0 comments on commit e3bcac0

Please sign in to comment.