From 4591618e7b090bc68d335afeb8636f9c614255ae Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 22 Apr 2026 16:20:31 -0400 Subject: [PATCH] feat(web): add TanStack Query client singleton Tuned defaults: retry disabled (we throw typed errors), 30s staleTime to make tab-switch re-navigation feel instant, no refetchOnWindowFocus (users on a music app don't expect spurious network when they tab back). --- web/src/lib/query/client.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 web/src/lib/query/client.ts diff --git a/web/src/lib/query/client.ts b/web/src/lib/query/client.ts new file mode 100644 index 00000000..55cb02f1 --- /dev/null +++ b/web/src/lib/query/client.ts @@ -0,0 +1,11 @@ +import { QueryClient } from '@tanstack/svelte-query'; + +export const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + staleTime: 30_000, + refetchOnWindowFocus: false + } + } +});