Skip to content

Commit

Permalink
fix search list
Browse files Browse the repository at this point in the history
  • Loading branch information
mtwmt committed Oct 3, 2023
1 parent ff7c52d commit b247f11
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/app/ironman/ironman-store.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
switchMap,
tap,
} from 'rxjs';
import { IronmanListInfo } from './ironman.model';
import { IronmanListInfo, NthKey } from './ironman.model';
import { IronmanService } from './ironman.service';

@Injectable({
Expand All @@ -26,23 +26,26 @@ export class IronmanStoreService {
new BehaviorSubject([] as IronmanListInfo[]);

private ironmanTh = [
'15th',
'14th',
'13th',
'12th',
'11th',
'10th',
'9th',
'8th',
'7th',
'',
NthKey.All,
NthKey.Th15,
NthKey.Th14,
NthKey.Th13,
NthKey.Th12,
NthKey.Th11,
NthKey.Th10,
NthKey.Th9,
NthKey.Th8,
NthKey.Th7,
NthKey.History,
];

constructor(private ironmanService: IronmanService) {
this.ironmanTh.forEach((th) => {
this.ironmanObservables[th] = this.ironmanService
.fetchIronman(th)
.pipe(shareReplay(1));
if (th !== NthKey.All) {
this.ironmanObservables[th] = this.ironmanService
.fetchIronman(th)
.pipe(shareReplay(1));
}
});
}

Expand Down
File renamed without changes.

0 comments on commit b247f11

Please sign in to comment.