'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _immutable = require('immutable');

var _constants = require('../../constants');

var defaultState = (0, _immutable.fromJS)({
  apiEndpoint: ''
});

exports.default = function () {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultState;
  var action = arguments[1];

  switch (action.type) {
    case _constants.SET_API_ENDPOINT:
      return state.set('apiEndpoint', action.payload);
    case _constants.SET_USER_TOKEN:
      return state.set('userToken', action.payload);
    default:
      return state;
  }
};