mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-26 01:44:53 +10:00
v5.1.0 (#2970)
* chore(release): v5.1.0 * feat: implement resume thumbnails * fix: remove unused mcp tools * docs: fix formatting of docs
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
import { StandardRPCJsonSerializer } from "@orpc/client/standard";
|
||||
import { MutationCache, QueryClient } from "@tanstack/react-query";
|
||||
|
||||
const serializer = new StandardRPCJsonSerializer();
|
||||
|
||||
export const getQueryClient = () => {
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
gcTime: 5 * 60 * 1000, // 5 minutes
|
||||
staleTime: 60 * 1000, // 1 minute
|
||||
queryKeyHashFn(queryKey) {
|
||||
const [json, meta] = serializer.serialize(queryKey);
|
||||
return JSON.stringify({ json, meta });
|
||||
},
|
||||
},
|
||||
dehydrate: {
|
||||
serializeData(data) {
|
||||
const [json, meta] = serializer.serialize(data);
|
||||
return { json, meta };
|
||||
},
|
||||
},
|
||||
hydrate: {
|
||||
deserializeData(data) {
|
||||
return serializer.deserialize(data.json, data.meta);
|
||||
},
|
||||
},
|
||||
},
|
||||
mutationCache: new MutationCache({
|
||||
onSettled: (_1, _2, _3, _4, _5, context) => {
|
||||
if (context?.meta?.noInvalidate) return;
|
||||
void queryClient.invalidateQueries();
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
return queryClient;
|
||||
};
|
||||
Reference in New Issue
Block a user