Created
April 16, 2018 07:35
-
-
Save 197291/0a821120cc1435eb1516d5f66fbc5d0c 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
import * as consts from 'redux/constants'; | |
export default store => next => action => { | |
const {error} = action; | |
if (error && error.response && error.response.data.result === 5) { | |
next({ type: consts.DISPLAY_ERROR, error: error.response.data}); | |
} else { | |
next(action); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment