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

app.config.ts

31 lines726 Bytes

1import {
2 provideHttpClient,
3 withFetch,
4 withInterceptors,
5} from '@angular/common/http'
6import {
7 QueryClient,
8 provideTanStackQuery,
9 withDevtools,
10} from '@tanstack/angular-query-experimental'
11import { autocompleteMockInterceptor } from './api/autocomplete-mock.interceptor'
12import type { ApplicationConfig } from '@angular/core'
13​
14export const appConfig: ApplicationConfig = {
15 providers: [
16 provideHttpClient(
17 withFetch(),
18 withInterceptors([autocompleteMockInterceptor]),
19 ),
20 provideTanStackQuery(
21 new QueryClient({
22 defaultOptions: {
23 queries: {
24 gcTime: 1000 * 60 * 60 * 24, // 24 hours
25 },
26 },
27 }),
28 withDevtools(),
29 ),
30 ],