feat: set react-query cache time
This commit is contained in:
parent
18cad832bb
commit
473ba2e367
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue