You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
558 B
24 lines
558 B
7 years ago
|
import { combineReducers } from 'redux';
|
||
|
import { enableBatching } from 'redux-batched-actions';
|
||
|
import actions from 'Store/Actions';
|
||
5 years ago
|
import { connectRouter } from 'connected-react-router';
|
||
7 years ago
|
|
||
|
const defaultState = {};
|
||
5 years ago
|
const reducers = {};
|
||
7 years ago
|
|
||
|
actions.forEach((action) => {
|
||
|
const section = action.section;
|
||
|
|
||
|
defaultState[section] = action.defaultState;
|
||
|
reducers[section] = action.reducers;
|
||
|
});
|
||
|
|
||
|
export { defaultState };
|
||
5 years ago
|
|
||
|
export default function(history) {
|
||
|
return enableBatching(combineReducers({
|
||
|
...reducers,
|
||
|
router: connectRouter(history)
|
||
|
}));
|
||
|
}
|