Skip to content

Instantly share code, notes, and snippets.

@anghelalexandra
Created October 12, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anghelalexandra/2b7eca714df5cc0843a324612d624908 to your computer and use it in GitHub Desktop.
Save anghelalexandra/2b7eca714df5cc0843a324612d624908 to your computer and use it in GitHub Desktop.
import { combineReducers } from "redux";
const productsReducer = (state = [], action) => {
switch (action.type) {
case "REQUEST_PRODUCTS":
return state;
case "RECEIVE_PRODUCTS":
return action.products;
default:
return state;
}
};
export default productsReducer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment