Sha256: 329d7e02ef7a49c2a7f7996406d08c47ff2f4d85bcfc0583b246206649b1e356
Contents?: true
Size: 823 Bytes
Versions: 9
Compression:
Stored size: 823 Bytes
Contents
import Immutable from 'seamless-immutable'; import { STATUS } from 'foremanReact/constants'; import { INVENTORY_SYNC_REQUEST, INVENTORY_SYNC_SUCCESS, INVENTORY_SYNC_FAILURE, } from './SyncButtonConstants'; export default ( state = Immutable({}), { type, payload: { syncHosts, disconnectHosts, error } = {} } ) => { switch (type) { case INVENTORY_SYNC_REQUEST: return state.merge({ ...state, status: STATUS.PENDING, error: null, }); case INVENTORY_SYNC_SUCCESS: return state.merge({ ...state, status: STATUS.RESOLVED, syncHosts, disconnectHosts, }); case INVENTORY_SYNC_FAILURE: return state.merge({ ...state, status: STATUS.ERROR, error, }); default: return state; } };
Version data entries
9 entries across 9 versions & 1 rubygems