Skip to content

Commit

Permalink
fix: move takeUntil
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Jun 17, 2020
1 parent 84f3619 commit 17cd7ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions projects/router/src/lib/router.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,22 @@ export class RouterComponent {
combineLatest(this.routes$.pipe(debounceTime(1)), this.router.url$)
.pipe(
distinctUntilChanged(),
takeUntil(this.destroy$),
tap(([routes, url]: [Route[], string]) => {
let routeToRender = null;
for (const route of routes) {
routeToRender = this.findRouteMatch(route, url);

if (routeToRender) {
this.setRoute(url, route);
break;
}
}

if (!routeToRender) {
this.setActiveRoute({ route: null, params: {} });
}
})
}),
takeUntil(this.destroy$)
)
.subscribe();
}
Expand Down

0 comments on commit 17cd7ff

Please sign in to comment.