29 lines
743 B
TypeScript
29 lines
743 B
TypeScript
import {
|
|
provideHttpClient,
|
|
withFetch,
|
|
withInterceptors,
|
|
} from '@angular/common/http'
|
|
import {
|
|
QueryClient,
|
|
provideTanStackQuery,
|
|
} from '@tanstack/angular-query-experimental'
|
|
import { withDevtools } from '@tanstack/angular-query-experimental/devtools'
|
|
import { mockInterceptor } from './interceptor/mock-api.interceptor'
|
|
import type { ApplicationConfig } from '@angular/core'
|
|
|
|
export const appConfig: ApplicationConfig = {
|
|
providers: [
|
|
provideHttpClient(withFetch(), withInterceptors([mockInterceptor])),
|
|
provideTanStackQuery(
|
|
new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
gcTime: 1000 * 60 * 60 * 24, // 24 hours
|
|
},
|
|
},
|
|
}),
|
|
withDevtools(),
|
|
),
|
|
],
|
|
}
|