Skip to content
Source
Sign inSign up
TanStack/query
Open History to see the last commit

makeQueryClient.ts

13 lines341 Bytes

1import { QueryClient } from '@tanstack/preact-query'
2​
3export function makeQueryClient() {
4 return new QueryClient({
5 defaultOptions: {
6 queries: {
7 // With SSR, we usually want to set some default staleTime
8 // above 0 to avoid refetching immediately on the client
9 staleTime: 60 * 1000,
10 },
11 },
12 })