Skip to content

Commit

Permalink
Merge pull request #733 from sjinks/add-named-export
Browse files Browse the repository at this point in the history
feat: add named export
  • Loading branch information
sjinks authored Sep 17, 2023
2 parents 1fd393b + 85b3d3d commit b8a9263
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function sanitize(params: FetchRetryParams, defaults: Required<FetchRetryParams>
}

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export default function <F extends (...args: any) => Promise<any> = typeof fetch>(
export function fetchBuilder<F extends (...args: any) => Promise<any> = typeof fetch>(
fetchFunc: F,
params: FetchRetryParams = {},
): (input: Parameters<F>[0], init?: Parameters<F>[1] & FetchRetryParams) => ReturnType<F> {
Expand Down Expand Up @@ -90,3 +90,5 @@ export default function <F extends (...args: any) => Promise<any> = typeof fetch
}) as ReturnType<F>;
};
}

export default fetchBuilder;

0 comments on commit b8a9263

Please sign in to comment.