"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isPending = isPending;
exports.getResponse = getResponse;
exports.default = void 0;

var _actionCodes = require("../constants/actionCodes");

var _default = (state = {}, action) => {
  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;
}