previous state in reducers in redux with react
问题 Here is what my reducer looks like: export default function catalogReducer(state = initialState.catalogItems, action){ switch (action.type) { case types.LOAD_CATALOG_SUCCESS: return { count:action.count, products :[...state['products'], action.catalogItems ? [...action.catalogItems['products']] : [] ] default: return state; } } What I want to do: This is a reducer for loading catalog items Items are coming from a paginated api. I need to add results from api to existing list of products