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

app.config.ts

26 lines750 Bytes

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