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