rename methods that get all router/navigation events

pull/7537/head
Arman Ozak 5 years ago
parent 2778998c4a
commit c608fa85df

@ -42,11 +42,11 @@ export class RouterEvents {
return this.router.events.pipe(filter(filterNavigationEvents));
}
getAnyEvent() {
getAllEvents() {
return this.router.events;
}
getAnyNavigationEvent() {
getAllNavigationEvents() {
const keys = Object.keys(NavigationEvent) as NavigationEventKeys;
return this.getNavigationEvents(...keys);
}
@ -56,5 +56,6 @@ type RouterEventConstructors = [Type<RouterEvent>, ...Type<RouterEvent>[]];
type NavigationEventKeys = [NavigationEventKey, ...NavigationEventKey[]];
export type NavigationEventType = typeof NavigationEvent;
type NavigationEventType = typeof NavigationEvent;
export type NavigationEventKey = keyof NavigationEventType;

@ -24,7 +24,7 @@ export class RouterWaitService {
private updateLoadingStatusOnNavigationEvents() {
this.routerEvents
.getAnyNavigationEvent()
.getAllNavigationEvents()
.pipe(
map(event => event instanceof NavigationStart),
switchMap(condition =>

@ -67,7 +67,7 @@ describe('RouterEvents', () => {
describe('getAnyNavigationEvent', () => {
it('should return a stream of any navigation event', () => {
const stream = service.getAnyNavigationEvent();
const stream = service.getAllNavigationEvents();
const collected: number[] = [];
stream.pipe(take(4)).subscribe(event => collected.push(event.id));
@ -93,7 +93,7 @@ describe('RouterEvents', () => {
describe('getAnyEvent', () => {
it('should return a stream of any router event', () => {
const stream = service.getAnyEvent();
const stream = service.getAllEvents();
const collected: number[] = [];
stream.pipe(take(8)).subscribe((event: RouterEvent) => collected.push(event.id));

Loading…
Cancel
Save