You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

createReducer.js 262B

12345678910111213
  1. const createReducer = (handlers, initialState) => {
  2. return (state = initialState, action) => {
  3. const reducer = handlers[action.type];
  4. if (!reducer) {
  5. return state;
  6. }
  7. return reducer(state, action);
  8. };
  9. };
  10. export default createReducer;