UNPKG

cspace-ui

Version:
28 lines (27 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSystemInfo = exports.getConfig = exports.default = void 0; var _immutable = _interopRequireDefault(require("immutable")); var _actionCodes = require("../constants/actionCodes"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var _default = (state = _immutable.default.Map(), action) => { switch (action.type) { case _actionCodes.CSPACE_CONFIGURED: return state.set('config', _immutable.default.fromJS(action.payload)); case _actionCodes.SYSTEM_INFO_READ_FULFILLED: return state.set('systemInfo', _immutable.default.fromJS(action.payload.data)); case _actionCodes.SYSTEM_INFO_READ_REJECTED: return state.set('systemInfo', _immutable.default.fromJS({ error: action.payload })); default: return state; } }; exports.default = _default; const getConfig = state => state.get('config'); exports.getConfig = getConfig; const getSystemInfo = state => state.get('systemInfo'); exports.getSystemInfo = getSystemInfo;