feat: set react-query cache time

This commit is contained in:
DIYgod 2023-07-13 11:21:12 +01:00
parent 18cad832bb
commit 473ba2e367
No known key found for this signature in database
1 changed files with 12 additions and 1 deletions

View File

@ -2,5 +2,16 @@ import { cache } from "react"
import { QueryClient } from "@tanstack/react-query"
const getQueryClient = cache(() => new QueryClient())
const getQueryClient = cache(
() =>
new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 1000,
cacheTime: 60 * 1000,
},
},
}),
)
export default getQueryClient