export default function(initialState, handlers) { return function(state = initialState, action) { const handler = handlers[action.type]; return typeof hander === 'function' ? handler(state, action) : state; } }