'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.logout = exports.LOGOUT_FULFILLED = exports.LOGOUT_STARTED = undefined;

var _cspace = require('./cspace');

var _cspace2 = _interopRequireDefault(_cspace);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var LOGOUT_STARTED = exports.LOGOUT_STARTED = 'LOGOUT_STARTED';
var LOGOUT_FULFILLED = exports.LOGOUT_FULFILLED = 'LOGOUT_FULFILLED';

var logout = exports.logout = function logout() {
  return function (dispatch) {
    dispatch({
      type: LOGOUT_STARTED
    });

    return (0, _cspace2.default)().logout().then(function (response) {
      return dispatch({
        type: LOGOUT_FULFILLED,
        payload: response
      });
    });
  };
};