All files / src/utils handleActions.js

100% Statements 5/5
100% Branches 3/3
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 94x 30x 30x 1x     29x    
export default (handlers) => (state = {}, action) => {
  const handler = handlers[action.type];
  if (typeof handler !== 'function') {
    return state;
  }
 
  return handler(state, action);
}