Skip to content
Snippets Groups Projects
index.js 238 B
Newer Older
Louis's avatar
Louis committed
module.exports = function(initial, handlers) {
    return function(state = initial, {type, ...action}) {
        if (handlers.hasOwnProperty(type)) {
            return handlers[type](state, action)
        }
        return state
    }
}