text: // import update from 'immutability-helper';
  import {
  	EXERCISE_IDLE
  } from '../../constants/lab3/index';
  
  export const types = {
  	UPDATE_STATE: '@accessibility-lab/lab3/exercise/update_state',
  	ENABLE_END: '@accessibility-lab/lab3/exercise/enable_end'
  };
  
  export const initialState = {
  	state: EXERCISE_IDLE,
  	end: false
  };
  
  const ExerciseReducer = (state = initialState, action) => {
  	switch (action.type) {
  		case types.UPDATE_STATE:
  			return {
  				...state,
  				state: action.state
  			};
  		case types.ENABLE_END:
  			return {
  				...state,
  				end: action.state
  			};
  
  		default:
  			return state;
  	}
  };
  
  export const actions = {
  	updateState: (state) => ({ type: types.UPDATE_STATE, state }),
  	enableEnd: (state) => ({ type: types.ENABLE_END, state })
  };
  
  export default ExerciseReducer;
  
  