Download react-query/examples/angular/basic-persister/src/app/app.config.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 981 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/basic-persister/src/app/app.config.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset@1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/basic-persister/src/app/app.config.ts
-
curl -L -o app.config.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/1e92f2d0b9e054abc23a53595fd89ad3e2b4a34e/react-query/examples/angular/basic-persister/src/app/app.config.ts
981 Bytes
| import { provideHttpClient, withFetch } from '@angular/common/http' | |
| import { | |
| QueryClient, | |
| provideTanStackQuery, | |
| withDevtools, | |
| } from '@tanstack/angular-query-experimental' | |
| import { withPersistQueryClient } from '@tanstack/angular-query-persist-client' | |
| import { createAsyncStoragePersister } from '@tanstack/query-async-storage-persister' | |
| import type { ApplicationConfig } from '@angular/core' | |
| const localStoragePersister = createAsyncStoragePersister({ | |
| storage: window.localStorage, | |
| }) | |
| export const appConfig: ApplicationConfig = { | |
| providers: [ | |
| provideHttpClient(withFetch()), | |
| provideTanStackQuery( | |
| new QueryClient({ | |
| defaultOptions: { | |
| queries: { | |
| staleTime: 1000 * 60, // 1 minute | |
| gcTime: 1000 * 60 * 60 * 24, // 24 hours | |
| }, | |
| }, | |
| }), | |
| withDevtools(), | |
| withPersistQueryClient({ | |
| persistOptions: { | |
| persister: localStoragePersister, | |
| }, | |
| }), | |
| ), | |
| ], | |
| } | |