root = {
cart: { //=> cartReducer
checkout: [], //=> checkoutReducer
saved: [],
left: false
}
}
function cartReducer = (state, action) => {
switch(action.type) {
'LEFT': return { ...state, left: action.payload };
}
}
function checkoutReducer = (state, action) => {
switch(action.type) {
'ADD_ITEM': return [...state, action.payload[;
}
}
Last active
March 8, 2018 16:34
-
-
Save amcdnl/6998c0dbad7af5f424dc7719527f9fb8 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
./app/app.module.ts
./app/shared/store/reducers/index.ts
./app/shared/store/reducers/cart.reducers.ts
./app/shared/store/reducers/checkout.reducers.ts