(cacheOptions: HttpTransferCacheOptions)
| 437 | * |
| 438 | */ |
| 439 | export function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[] { |
| 440 | return [ |
| 441 | { |
| 442 | provide: CACHE_OPTIONS, |
| 443 | useFactory: (): CacheOptions => { |
| 444 | performanceMarkFeature('NgHttpTransferCache'); |
| 445 | return {isCacheActive: true, ...cacheOptions}; |
| 446 | }, |
| 447 | }, |
| 448 | { |
| 449 | provide: HTTP_ROOT_INTERCEPTOR_FNS, |
| 450 | useValue: transferCacheInterceptorFn, |
| 451 | multi: true, |
| 452 | }, |
| 453 | { |
| 454 | provide: APP_BOOTSTRAP_LISTENER, |
| 455 | multi: true, |
| 456 | useFactory: () => { |
| 457 | const appRef = inject(ApplicationRef); |
| 458 | const cacheState = inject(CACHE_OPTIONS); |
| 459 | |
| 460 | return () => { |
| 461 | appRef.whenStable().then(() => { |
| 462 | cacheState.isCacheActive = false; |
| 463 | }); |
| 464 | }; |
| 465 | }, |
| 466 | }, |
| 467 | ]; |
| 468 | } |
| 469 | |
| 470 | /** |
| 471 | * This function will add a proxy to an HttpHeader to intercept calls to get/has |
no test coverage detected
searching dependent graphs…