Refactored server reducer, removing duplicated code and taking advantage of redux-actions

This commit is contained in:
Alejandro Celaya
2019-03-17 09:06:10 +01:00
parent 724c804971
commit 51b5f6264d
3 changed files with 16 additions and 35 deletions

View File

@@ -21,9 +21,7 @@ export const selectServer = (serversService) => (serverId) => (dispatch) => {
});
};
const reducer = handleActions({
export default handleActions({
[RESET_SELECTED_SERVER]: () => defaultState,
[SELECT_SERVER]: (state, { selectedServer }) => selectedServer,
}, defaultState);
export default reducer;