import { QueryClient } from '@tanstack/svelte-query'; /** * App-wide QueryClient singleton. `+layout.svelte` wires it into the * provider; non-component code (Svelte actions, keyboard handlers) imports * it directly to read cached photo state and invalidate after mutations. */ export const queryClient = new QueryClient({ defaultOptions: { queries: { staleTime: 30_000, retry: 1, // The indexer WebSocket (stores/indexer.svelte.ts) already // invalidates ['photos'] and friends on live changes, so a // window-focus refetch only adds a redundant full-timeline // re-render (visible flash) every time the tab regains focus. refetchOnWindowFocus: false } } });