cuz
Version:
Front-end modular development kit.
15 lines (12 loc) • 355 B
JavaScript
exports.__esModule = true;
exports.createReducer = createReducer;
function createReducer(initialState, handlers) {
return function reducer(state, action) {
if (state === undefined) state = initialState;
if (handlers.hasOwnProperty(action.type)) {
return handlers[action.type](state, action);
}
return state;
};
}
;