Redux changes and refactoring
This commit is contained in:
25
src/redux/reducers/install_reducer.js
Normal file
25
src/redux/reducers/install_reducer.js
Normal 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,
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user