Last active
October 2, 2018 07:09
-
-
Save adrianfaciu/828b3ab47ba2a03a5032e639444fb1d7 to your computer and use it in GitHub Desktop.
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
loadDocuments$ = this.actions$.pipe( | |
ofType<documentActions.Fetch>(documentActions.FETCH) | |
switchMap((action) => | |
this.documentsService | |
.getDocuments().pipe( | |
map(docs => new documentActions.FetchSuccess(docs)), | |
catchError(error => of( | |
new ErrorOccurred({ | |
action, | |
error, | |
}) | |
)) | |
) | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you want this:
action
can be taken from the switchMap argument.err
. You are usingerror
in thenew ErrorOccurred