MCPcopy Create free account
hub / github.com/angular/angular / preload

Method preload

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

takeFunction · 0.85
catchErrorFunction · 0.85
indexOfMethod · 0.80
fnFunction · 0.50

Tested by

no test coverage detected