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

app.config.ts

28 lines682 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 { mockInterceptor } from './interceptor/mock-api.interceptor'
12import type { ApplicationConfig } from '@angular/core'
13​
14export const appConfig: ApplicationConfig = {
15 providers: [
16 provideHttpClient(withFetch(), withInterceptors([mockInterceptor])),
17 provideTanStackQuery(
18 new QueryClient({
19 defaultOptions: {
20 queries: {
21 gcTime: 1000 * 60 * 60 * 24, // 24 hours
22 },
23 },
24 }),
25 withDevtools(),
26 ),
27 ],