-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: recordsCount$ should not catch the error
- Loading branch information
Showing
5 changed files
with
29 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { Injectable } from '@angular/core' | ||
import { Observable, of, switchMap } from 'rxjs' | ||
import { catchError, shareReplay } from 'rxjs/operators' | ||
import { shareReplay } from 'rxjs/operators' | ||
import { RecordsRepositoryInterface } from '@geonetwork-ui/common/domain/repository/records-repository.interface' | ||
|
||
@Injectable({ | ||
providedIn: 'root', | ||
}) | ||
export class RecordsService { | ||
recordsCount$: Observable<number> = of(0).pipe( | ||
recordsCount$: Observable<number> = of(true).pipe( | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
fgravin
Author
Member
|
||
switchMap(() => this.recordsRepository.getMatchesCount({})), | ||
shareReplay(1), | ||
catchError(() => of(0)) | ||
shareReplay(1) | ||
) | ||
|
||
constructor(private recordsRepository: RecordsRepositoryInterface) {} | ||
|
Seems like
EMPTY.pipe(.......
is what you're looking for