Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { appActions } from '../actions/app';
- const initialState = {
- app: {
- isBootstrapped: false,
- },
- };
- const commonReducer = (state = initialState, action) => {
- switch (action.type) {
- case appActions.BOOTSTRAP_APP:
- return {
- ...state,
- app: {
- ...state.app,
- isBootstrapped: false,
- },
- };
- case appActions.BOOTSTRAP_APP_SUCCESS:
- return {
- ...state,
- app: {
- ...state.app,
- isBootstrapped: true,
- bootstrapError: false,
- },
- };
- case appActions.BOOTSTRAP_APP_ERROR:
- return {
- ...state,
- app: {
- ...state.app,
- isBootstrapped: false,
- bootstrapError: true,
- },
- };
- default:
- return state;
- }
- };
- export default commonReducer;
Add Comment
Please, Sign In to add comment