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

app.config.ts

29 lines688 Bytes

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