all files / src/redux/reducers/ statuses.js

69.57% Statements 16/23
66.67% Branches 10/15
100% Functions 2/2
100% Lines 14/14
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37                        69× 69×   69×               67×      
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.initialState = undefined;
exports.default = statusesReducer;
 
var _statuses = require('../actions/statuses');
 
var Actions = _interopRequireWildcard(_statuses);
 
function _interopRequireWildcard(obj) { Eif (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
 
var initialState = exports.initialState = {
  ec2: [],
  clusters: []
};
 
function statusesReducer() {
  var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState;
  var action = arguments[1];
 
  switch (action.type) {
    case Actions.UPDATE_EC2_LIST:
      {
        return Object.assign({}, state, { ec2: action.list });
      }
    case Actions.UPDATE_CLUSTERS_LIST:
      {
        return Object.assign({}, state, { clusters: action.list });
      }
    default:
      return state;
  }
}