MCPcopy Index your code
hub / github.com/angular/angular / preload

Method preload

packages/router/test/router_preloader.spec.ts:298–309  ·  view source on GitHub ↗
(route: Route, fn: () => Observable<unknown>)

Source from the content-addressed store, hash-verified

296 const mockPreloaderFactory = (): PreloadingStrategy => {
297 class DelayedPreLoad implements PreloadingStrategy {
298 preload(route: Route, fn: () => Observable<unknown>): Observable<unknown> {
299 const routeName = route.loadChildren
300 ? (route.loadChildren as jasmine.Spy).and.identity
301 : 'noChildren';
302 return delayLoadObserver$.pipe(
303 filter((unpauseList) => unpauseList.indexOf(routeName) !== -1),
304 take(1),
305 switchMap(() => {
306 return fn().pipe(catchError(() => of(null)));
307 }),
308 );
309 }
310 }
311 return new DelayedPreLoad();
312 };

Callers

nothing calls this directly

Calls 3

catchErrorFunction · 0.85
indexOfMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected