Skip to content

Commit

Permalink
move delays to param
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-zijdemans-vipps committed Sep 24, 2024
1 parent 70dd8b0 commit 3d7ef5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import type { ClientResponse } from "./types_internal.ts";
* @template TErr - The type of the error response data.
* @param {Request} request - The request to fetch.
* @param {boolean} [retryRequest=true] - Whether to retry the request on failure.
* @param {number[]} [delays=[1000, 3000]] - The delays between retries in milliseconds.
* @returns {Promise<ClientResponse<TOk, TErr>>} A promise that resolves to a ClientResponse object.
*/
export const fetchRetry = <TOk, TErr>(
request: Request,
retryRequest: boolean = true,
delays: number[] = [1000, 3000],
): Promise<ClientResponse<TOk, TErr>> => {
const delays = [1000, 3000];

/**
* Attempts to fetch the request recursively with retry logic.
*
Expand Down

0 comments on commit 3d7ef5b

Please sign in to comment.