Created
October 16, 2019 07:35
-
-
Save Sawtaytoes/6f954ea6ff5720974cc98e3729e118c0 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
const dispatchOnError = ( | |
actionCreator, | |
returnValue, | |
) => ( | |
catchError(( | |
error, | |
) => { | |
dispatch( | |
actionCreator( | |
error, | |
) | |
) | |
return ( | |
returnValue | |
? of(returnValue) | |
: EMPTY | |
) | |
}) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment