Created
October 8, 2019 12:01
-
-
Save IAfanasovMob/d7420c3192423841ce5b928ba6562c1d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
loadStarred() { | |
this.http.get<Repo[]>(`https://api.github.com/users/${this.userName}/starred`) | |
.pipe( | |
tap( | |
response => { | |
this.repos = response; | |
this.errorMessage = null; | |
} | |
), | |
catchError(error => { | |
this.repos = []; | |
this.errorMessage = error && error.error && error.error.message || 'Unknown error'; | |
return of([]); | |
}) | |
) | |
.subscribe(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment