All files / reducers PageletReducer.js

100% Statements 6/6
100% Branches 3/3
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14    1x 2x     3x   2x   1x      
import { TOGGLE_PAGELET } from '../actionTypes';
 
const initialState = {};
const toggle = (state, action) => ({ ...state, [action.pagelet]: action.status });
 
export default function (state = initialState, action) {
  switch (action.type) {
    case TOGGLE_PAGELET:
      return toggle(state, action);
    default:
      return state;
  }
}