1
0
mirror of https://github.com/tooot-app/app synced 2025-06-05 22:19:13 +02:00
Files
tooot/src/utils/queryHooks/index.ts
2023-01-03 23:57:23 +01:00

25 lines
497 B
TypeScript

import { QueryClient } from '@tanstack/react-query'
export const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 1000 * 60 * 5,
retry: (failureCount, error: any) => {
if (error?.status === 404) {
return false
}
if (failureCount <= 3) {
return true
} else {
return false
}
}
}
},
logger: {
log: log => console.log(log),
warn: () => {},
error: () => {}
}
})