All files / src reducers.js

100% Statements 3/3
100% Branches 0/0
100% Functions 2/2
100% Lines 3/3
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
}