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 c9ad316ed5
commit aa77faf314

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$();