kimjuny/koa-react-universal

View on GitHub
src/client/models/reducers/createReducer.js

Summary

Maintainability
A
0 mins
Test Coverage
const createReducer = (initState, handlers) => {
  const reducer = (state = initState, action) => {
    const handler = handlers[action.type];
    return handler ? handler(state, action) : state;
  };
  return reducer;
};

export default createReducer;