14 lines
497 B
TypeScript
Executable file
14 lines
497 B
TypeScript
Executable file
import { QueryClient } from '@tanstack/react-query';
|
|
import { isAbortError } from '@/src/lib/fetch-json';
|
|
|
|
const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
// Aborted requests (our 90s request cap) fail fast instead of being retried 3 more times.
|
|
retry: (failureCount, error) => !isAbortError(error) && failureCount < 3,
|
|
refetchOnWindowFocus: false,
|
|
staleTime: 1200000,
|
|
},
|
|
}
|
|
});
|
|
export default queryClient;
|