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

app.config.ts

26 lines655 Bytes

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