Redux changes and refactoring

This commit is contained in:
Scott E. Graves
2019-06-07 15:34:09 -05:00
parent a326d7762f
commit 704a357dd0
5 changed files with 177 additions and 75 deletions

View File

@@ -0,0 +1,25 @@
import {createReducer} from 'redux-starter-kit';
import {setInstallActive, setInstallComplete} from '../actions/install_actions';
export const installReducer = createReducer({
InstallActive: false,
InstallResult: null,
InstallType: null,
}, {
[setInstallActive]: (state, action) => {
return {
...state,
InstallActive: true,
InstallResult: null,
InstallType: action.payload,
};
},
[setInstallComplete]: (state, action) => {
return {
...state,
InstallActive: false,
InstallResult: action.payload,
InstallType: null,
}
}
});