Last active
June 4, 2018 15:29
-
-
Save mvbattan/45dd3c2b3bc15892124bf87bd1da484a to your computer and use it in GitHub Desktop.
Reducer description
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 reducerDescription = { | |
[actions.GET_MATCHES]: (state, action) => ({ ...state, matchesLoading: true }), | |
[actions.GET_MATCHES_SUCCESS]: (state, action) => ({ | |
...state, | |
matchesLoading: false, | |
matchesError: null, | |
matches: action.payload | |
}), | |
[actions.GET_MATCHES_FAILURE]: (state, action) => ({ | |
...state, | |
matchesLoading: false, | |
matchesError: action.payload | |
}), | |
[actions.GET_PITCHES]: (state, action) => ({ ...state, pitchesLoading: true }), | |
[actions.GET_PITCHES_SUCCESS]: (state, action) => ({ | |
...state, | |
pitchesLoading: false, | |
pitchesError: null, | |
pitches: action.payload | |
}), | |
[actions.GET_PITCHES_FAILURE]: (state, action) => ({ | |
...state, | |
pitchesLoading: false, | |
pitchesError: action.payload | |
}) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment