Skip to content

Commit

Permalink
fix: set default react-query staleTime to 1h.
Browse files Browse the repository at this point in the history
  • Loading branch information
pomegranited committed Jan 17, 2025
1 parent e92eeb6 commit 244cfc6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ import { ToastProvider } from './generic/toast-context';
import 'react-datepicker/dist/react-datepicker.css';
import './index.scss';

const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 60 * 60_000, // If cache is up to one hour old, no need to re-fetch
},
},
});

const App = () => {
useEffect(() => {
Expand Down

0 comments on commit 244cfc6

Please sign in to comment.