Lukasz-Semik / cash-organizer

Small app helping organize expenses. Technology stack: ReactJS, Redux, Webpack, Firebase, SCSS
1 stars 0 forks source link

editShoopingList #11

Closed michaelKurowski closed 6 years ago

michaelKurowski commented 6 years ago

https://github.com/Lukasz-Semik/cash-organizer/blob/80172dbca7300976928c065acc55a32c57a762f0/app/src/actions/dataActions.js#L179-L183

The name of this function indicates that it edits shooping list, but looks like it just returns an object. There are multiple such cases in this file. Please rename the functions, their names should describe what they really do.

Lukasz-Semik commented 6 years ago

In redux (react also), we cannot mutate the state directly. Instead of, we should give the new iteration of the state, wchich is merged to the previous one. So- this function return action with new state data (modifed), which will be merged in the reducer.

michaelKurowski commented 6 years ago

okay