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).
12 lines
228 B
TypeScript
12 lines
228 B
TypeScript
import { QueryClient } from '@tanstack/svelte-query';
|
|
|
|
export const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
retry: false,
|
|
staleTime: 30_000,
|
|
refetchOnWindowFocus: false
|
|
}
|
|
}
|
|
});
|