1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 3x 17x 9x | import {mergePlainObject, renamePlainObjectKey} from './util' import {handleActions} from 'redux-actions' const _modelMapHandler = ({namespace, reducers, initialState}) => ({[namespace]: handleActions(renamePlainObjectKey(namespace, reducers), initialState)}) function mergerReducers(modelList) { return modelList.map(_modelMapHandler).reduce(mergePlainObject, {}) } export { mergerReducers } |