diff --git a/packages/pockethost/src/core/tryFetch.ts b/packages/pockethost/src/core/tryFetch.ts index feb73fcf..d06e0525 100644 --- a/packages/pockethost/src/core/tryFetch.ts +++ b/packages/pockethost/src/core/tryFetch.ts @@ -3,7 +3,7 @@ import { LoggerService } from '../common' export const TRYFETCH_RETRY_MS = 50 -export type Config = { +export type TryFetchConfig = { preflight: () => Promise retryMs: number } @@ -21,8 +21,11 @@ export type Config = { * * Note: tryFetch exits ONLY on success or a rejected preflight. */ -export const tryFetch = async (url: string, config?: Partial) => { - const { preflight, retryMs }: Config = { +export const tryFetch = async ( + url: string, + config?: Partial, +) => { + const { preflight, retryMs }: TryFetchConfig = { preflight: async () => true, retryMs: TRYFETCH_RETRY_MS, ...config,