Open History to see the last commit
1import { provideHttpClient, withFetch } from '@angular/common/http'
2import {
3 provideClientHydration,
4 withEventReplay,
5} from '@angular/platform-browser'
6import { provideTanStackQuery } from '@tanstack/angular-query'
7import { withDevtools } from '@tanstack/angular-query-devtools'
8import { withPersistQueryClient } from '@tanstack/angular-query-persist-client'
9import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister'
10import { PERSIST_STORAGE_KEY, createQueryClient } from './query-client'
11import type { ApplicationConfig } from '@angular/core'
12β
13export const appConfig: ApplicationConfig = {
14 providers: [
15 provideHttpClient(withFetch()),
16 provideClientHydration(withEventReplay()),
17 provideTanStackQuery(
18 createQueryClient,
19 withDevtools(),
20 withPersistQueryClient(() => ({
21 persistOptions: {
22 persister: createAsyncStoragePersister({
23 storage: localStorage,
24 key: PERSIST_STORAGE_KEY,
25 throttleTime: 1000,
26 }),
27 },
28 })),
29 ),
30 ],
31}