"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
exports.getResponse = getResponse;
exports.isPending = isPending;
var _actionCodes = require("../constants/actionCodes");
var _default = function _default() {
  let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let action = arguments.length > 1 ? arguments[1] : undefined;
  switch (action.type) {
    case _actionCodes.LOGOUT_STARTED:
      return {
        ...state,
        isPending: true,
        response: null
      };
    case _actionCodes.LOGOUT_FULFILLED:
      return {
        ...state,
        isPending: false,
        response: action.payload
      };
    default:
      return state;
  }
};
exports.default = _default;
function isPending(state) {
  return state.isPending;
}
function getResponse(state) {
  return state.response;
}