Created
September 20, 2016 14:29
-
-
Save robrichard/78d2b464f78b4cc388ff1209ded3df4c to your computer and use it in GitHub Desktop.
This file contains 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
function (state = {}, action) { | |
switch (action.type) { | |
case 'VIEW_ORDERS': | |
return { | |
...state, | |
pageType: 'orders', | |
orderId: null | |
}; | |
case 'VIEW_ORDER': | |
return { | |
...state, | |
pageType: 'order', | |
orderId: action.orderId | |
}; | |
case 'VIEW_RECEIPT': | |
return { | |
...state, | |
pageType: 'receipt', | |
orderId: action.orderId | |
}; | |
} | |
return state; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment