mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-09-30 14:43:13 +00:00
20 lines
480 B
TypeScript
20 lines
480 B
TypeScript
|
|
import { QueryClient } from '@tanstack/react-query';
|
||
|
|
import { toast } from 'react-toastify';
|
||
|
|
|
||
|
|
export const queryClient = new QueryClient({
|
||
|
|
defaultOptions: {
|
||
|
|
queries: {
|
||
|
|
staleTime: 5 * 60 * 1000,
|
||
|
|
gcTime: 10 * 60 * 1000,
|
||
|
|
retry: 1,
|
||
|
|
refetchOnWindowFocus: false,
|
||
|
|
},
|
||
|
|
mutations: {
|
||
|
|
onError: (error) => {
|
||
|
|
const message = error instanceof Error ? error.message : 'An error occurred';
|
||
|
|
toast.error(message);
|
||
|
|
},
|
||
|
|
},
|
||
|
|
},
|
||
|
|
});
|