Created
April 11, 2017 10:20
-
-
Save brakmic/9ea7777fdf30085312f113c6f9b1a268 to your computer and use it in GitHub Desktop.
combine all of the reducers into one meta-reducer
This file contains 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 developmentReducer: ActionReducer<IAppState> = compose(storeFreeze, combineReducers)(reducers); | |
const productionReducer: ActionReducer<IAppState> = combineReducers(reducers); | |
// our meta-reducer will take care of forwarding all actions | |
export function AppReducer(state: any, action: any) { | |
if (String('<%= BUILD_TYPE %>') === 'dev') { | |
return developmentReducer(state, action); | |
} else { | |
return productionReducer(state, action); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment