summaryrefslogtreecommitdiff
path: root/apps/web/lib/query-client.ts
blob: c64e4c7eeff9d08a50c1e414eea231ad76d321da (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { QueryClient } from "@tanstack/react-query"

const TWENTY_FOUR_HOURS_IN_MILLISECONDS = 1000 * 60 * 60 * 24

export function createQueryClient() {
  return new QueryClient({
    defaultOptions: {
      queries: {
        staleTime: 60_000,
        gcTime: TWENTY_FOUR_HOURS_IN_MILLISECONDS,
        refetchOnWindowFocus: false,
      },
    },
  })
}