Last active
April 21, 2016 11:38
-
-
Save andrewjmead/06cb2e1088ad6a929a2d0fa729f3c03c to your computer and use it in GitHub Desktop.
Marcus Cart Reducer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ADD_TO_CART } from '../actions/index'; | |
export default function(state = [], action) { | |
switch(action.type) { | |
case ADD_TO_CART: | |
return [ | |
...state, | |
action.payload | |
]; | |
default: | |
return state; | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment