From d34a2f62b54148875377cc51a92fd20dc9d022fe Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Fri, 7 Jun 2024 03:07:32 -0700 Subject: [PATCH] chore(pockethost): rename TryCatchConfig --- packages/pockethost/src/core/tryFetch.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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,