mirror of
https://github.com/mempool/mempool.git
synced 2025-02-26 23:50:16 +01:00
10 lines
374 B
TypeScript
10 lines
374 B
TypeScript
import { PreloadingStrategy, Route } from '@angular/router';
|
|
import { Observable, timer, mergeMap, of } from 'rxjs';
|
|
|
|
export class AppPreloadingStrategy implements PreloadingStrategy {
|
|
preload(route: Route, load: Function): Observable<any> {
|
|
return route.data && route.data.preload
|
|
? timer(1500).pipe(mergeMap(() => load()))
|
|
: of(null);
|
|
}
|
|
}
|