Skip to content

Commit 1837fee

Browse files
committed
refactor(@angular-devkit/build-angular): use whenStable private API in route extractor
This commit refactors the route extractor to use the newly `whenStable` API.
1 parent 73db6db commit 1837fee

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/angular_devkit/build_angular/src/utils/routes-extractor/BUILD.bazel

-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,5 @@ ts_library(
2222
"@npm//@angular/platform-server",
2323
"@npm//@angular/router",
2424
"@npm//@types/node",
25-
"@npm//rxjs",
2625
],
2726
)

packages/angular_devkit/build_angular/src/utils/routes-extractor/extractor.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ import {
1313
Type,
1414
createPlatformFactory,
1515
platformCore,
16+
ɵwhenStable as whenStable,
1617
} from '@angular/core';
1718
import {
1819
INITIAL_CONFIG,
1920
ɵINTERNAL_SERVER_PLATFORM_PROVIDERS as INTERNAL_SERVER_PLATFORM_PROVIDERS,
2021
} from '@angular/platform-server';
2122
import { Route, Router, ɵloadChildren as loadChildrenHelper } from '@angular/router';
22-
import { first } from 'rxjs/operators'; // Import from `/operators` to support rxjs 6 which is still supported by the Framework.
2323

2424
interface RouterResult {
2525
route: string;
@@ -98,7 +98,7 @@ export async function* extractRoutes(
9898
}
9999

100100
// Wait until the application is stable.
101-
await applicationRef.isStable.pipe(first((isStable) => isStable)).toPromise();
101+
await whenStable(applicationRef);
102102

103103
const injector = applicationRef.injector;
104104
const router = injector.get(Router);

0 commit comments

Comments
 (0)