'use strict';

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

var _immutable = require('immutable');

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

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

  switch (action.type) {
    case _constants.ADD_ALERT:
      return state.set(action.payload.uuid, (0, _immutable.fromJS)(action.payload));
    case _constants.REMOVE_ALERT:
      return state.delete(action.payload.uuid);
    default:
      return state;
  }
};