import _objectSpread from "@babel/runtime/helpers/objectSpread";
import { ACTIONS } from './constants';
var DefaultState = {
  activeNamespace: undefined
};
export default (function () {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultState;
  var action = arguments.length > 1 ? arguments[1] : undefined;

  switch (action.type) {
    case ACTIONS.SET_ACTIVE_NAMESPACE:
      return _objectSpread({}, state, {
        activeNamespace: action.payload
      });

    case ACTIONS.SET_FULL_STATE:
      return _objectSpread({}, state, action.payload);

    case ACTIONS.RESET_ALL:
      return DefaultState;

    default:
      return state;
  }
});