Sha256: 7abac1583809c5b03419b17932a35541ff9addc3c319667688a445a0773903c0
Contents?: true
Size: 1.26 KB
Versions: 82
Compression:
Stored size: 1.26 KB
Contents
import Immutable from 'seamless-immutable'; import { INVENTORY_ACCOUNT_STATUS_POLLING, INVENTORY_ACCOUNT_STATUS_POLLING_ERROR, INVENTORY_ACCOUNT_STATUS_POLLING_START, INVENTORY_PROCESS_RESTART, } from './AccountListConstants'; const initialState = Immutable({ accounts: {}, pollingProcessID: 0, error: null, }); export default (state = initialState, action) => { const { payload: { pollingProcessID, error, accounts, accountID, processStatusName, CloudConnectorStatus, } = {}, } = action; switch (action.type) { case INVENTORY_ACCOUNT_STATUS_POLLING: return state.merge({ ...state, accounts, CloudConnectorStatus, error: null, }); case INVENTORY_ACCOUNT_STATUS_POLLING_ERROR: return state.merge({ ...state, accounts: {}, error, }); case INVENTORY_ACCOUNT_STATUS_POLLING_START: return state.merge({ ...state, pollingProcessID, }); case INVENTORY_PROCESS_RESTART: return state.setIn(['accounts'], { ...state.accounts, [accountID]: { ...state.accounts[accountID], [processStatusName]: 'Restarting...', }, }); default: return state; } };
Version data entries
82 entries across 82 versions & 1 rubygems