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

app.config.ts

21 lines607 Bytes

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