Use switchMap param instead of re-reading this.route.snapshot.fragment

This commit is contained in:
nymkappa 2022-02-05 19:06:27 +09:00
parent e3adf642d2
commit 123d321031

View File

@ -31,8 +31,8 @@ export class TelevisionComponent implements OnInit {
this.route.fragment
.pipe(
switchMap(() => {
switch (this.route.snapshot.fragment) {
switchMap((fragment) => {
switch (fragment) {
case '2h': return this.apiService.list2HStatistics$();
case '24h': return this.apiService.list24HStatistics$();
case '1w': return this.apiService.list1WStatistics$();