AG-1053 Tidy react examples, make more idiomatic
This commit is contained in:
16
src-examples/simpleReduxExample/gridDataReducer.jsx
Normal file
16
src-examples/simpleReduxExample/gridDataReducer.jsx
Normal file
@@ -0,0 +1,16 @@
|
||||
export default (state = {rowData: [], rowSelection: []}, action) => {
|
||||
switch (action.type) {
|
||||
case 'ROW_DATA_CHANGED':
|
||||
return {
|
||||
...state,
|
||||
rowData: action.rowData,
|
||||
};
|
||||
case 'ROW_SELECTION_CHANGED':
|
||||
return {
|
||||
...state,
|
||||
rowSelection: action.rowSelection,
|
||||
};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user