'use strict';

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

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _objectAssign = require('object-assign');

var _objectAssign2 = _interopRequireDefault(_objectAssign);

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

var viewStates = function viewStates() {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var _ref = arguments[1];
  var type = _ref.type,
      payload = _ref.payload;

  if (!payload) return state;
  if (!payload.id) return state;
  if (!payload.state) return state;
  switch (type) {
    case 'UPDATE_VIEW_STATE':
      return (0, _objectAssign2.default)({}, state, (0, _defineProperty3.default)({}, payload.id, (0, _objectAssign2.default)({}, state[payload.id], payload.state)));

    default:
      return state;
  }
};

exports.default = viewStates;
//# sourceMappingURL=view_states.js.map