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

app.config.ts

21 lines511 Bytes

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