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

+layout.ts

16 lines364 Bytes

1import { QueryClient } from '@tanstack/svelte-query'
2import type { LayoutLoad } from './$types'
3import { browser } from '$app/environment'
4​
5export const load: LayoutLoad = () => {
6 const queryClient = new QueryClient({
7 defaultOptions: {
8 queries: {
9 enabled: browser,
10 staleTime: 10 * 1000,
11 },
12 },
13 })
14​
15 return { queryClient }