Open History to see the last commit
1import type { ApplicationConfig } from '@angular/core'
2import { provideClientHydration, withEventReplay } from '@angular/platform-browser'
3import {
4 QueryClient,
5 provideTanStackQuery,
6} from '@tanstack/angular-query-experimental'
7import { withDevtools } from '@tanstack/angular-query-devtools'
8β
9export const sharedQueryDefaults = {
10 staleTime: 1000 * 30,
11 gcTime: 1000 * 60 * 60 * 24,
12} as const
13β
14export const createBrowserQueryClient = () =>
15 new QueryClient({
16 defaultOptions: {
17 queries: { ...sharedQueryDefaults },
18 },
19 })
20β
21export const getBaseAppConfig = (queryClient: QueryClient): ApplicationConfig => {
22 return {
23 providers: [
24 provideClientHydration(withEventReplay()),
25 provideTanStackQuery(queryClient, withDevtools()),
26 ],
27 }
28}
29β
30export const getClientAppConfig = (): ApplicationConfig =>
31 getBaseAppConfig(createBrowserQueryClient())