siminture
11/5/2018 - 10:27 AM

composeReducers


export default function composeReducers(...funcs) {
  if (funcs.length === 0) {
    return state => state;
  }

  if (funcs.length === 1) {
    return funcs[0];
  }

  return funcs.reduce((a, b) => (state, action) => a(b(state, action), action));
}