AG-730 New example for redux

This commit is contained in:
Sean Landsman
2017-08-31 17:17:26 +01:00
parent 5a45846cb7
commit 73cc989512
8 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
export default (state = {rowData: [], currencySymbol: '£', exchangeRate: 1}, action) => {
switch (action.type) {
case 'ROW_DATA_CHANGED':
return {
...state,
rowData: action.rowData,
};
case 'CURRENCY_CHANGED':
return {
...state,
currencySymbol: action.currencySymbol,
exchangeRate: action.exchangeRate
};
default:
return state;
}
};