text: import checkEmpty from "../validation/checkEmpty";
  import { SET_CURRENT_USER } from "../actions/types";
  
  const initialState = {
    isAuthenticated: false,
    user: {}
  };
  
  export default (state = initialState, action) => {
    switch (action.type) {
      case SET_CURRENT_USER:
        return {
          ...state,
          isAuthenticated: !checkEmpty(action.payload),
          user: action.payload
        };
      default:
        return state;
    }
  };
  