fix: cache
This commit is contained in:
1 parent
7f77f960d9
commit
095f7361fa
8 files changed
+95
-54
No files matched your search
+13
-2
@@ -1,5 +1,16 @@
|
||||
import { cache } from 'react';
|
||||
import { QueryClient } from '@tanstack/react-query';
|
||||
import { QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
||||
|
||||
const getQueryClient = cache(() => new QueryClient());
|
||||
export const queryClientOptions: QueryClientConfig = {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
staleTime: Infinity,
|
||||
refetchOnReconnect: false,
|
||||
refetchOnMount: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const getQueryClient = cache(() => new QueryClient(queryClientOptions));
|
||||
export default getQueryClient;
|
||||
Reference in new issue
Block a user