Sha256: f21c0450f44b7ffd8d11d7624ad6f745c301a7e7983cbf84ac33add0151b1abd
Contents?: true
Size: 801 Bytes
Versions: 11
Compression:
Stored size: 801 Bytes
Contents
import Immutable from 'seamless-immutable'; import { actionTypeGenerator } from 'foremanReact/redux/API'; export const initialState = Immutable({ sccProducts: [], sccAccountId: undefined, }); export default (state = initialState, action) => { const { payload } = action; const listTypes = actionTypeGenerator('SCC_PRODUCT_LIST'); switch (action.type) { case 'FETCH_PRODUCT_SUCCESS': return state.merge({ sccProducts: payload, }); case listTypes.REQUEST: return state.merge({ sccProducts: [], }); case listTypes.SUCCESS: return state.merge({ sccProducts: payload.data, }); case listTypes.FAILURE: return state.merge({ sccProducts: [payload.error], }); default: return state; } };
Version data entries
11 entries across 11 versions & 1 rubygems