import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread";

var _handleActions;

import { handleActions } from 'redux-actions';
import * as C from './constants';
export var initialState = {
  isAuthenticated: false
};
export var authLoginReducer = function authLoginReducer(state, action) {
  return _objectSpread({}, state, action.payload, {
    isAuthenticated: true
  });
};
export var authLogoutReducer = function authLogoutReducer(state) {
  return _objectSpread({}, initialState.auth);
};
export default handleActions((_handleActions = {}, _defineProperty(_handleActions, C.AUTH_LOGIN_DONE, authLoginReducer), _defineProperty(_handleActions, C.AUTH_LOGOUT, authLogoutReducer), _handleActions), initialState);