Closed doguhanokumus closed 6 years ago
https://github.com/cannc4/Siren/blob/7fcf5a4a285dc246b9f8c50c4a853d58d0273308/src/reducers/user.js#L6
You should use
let updatedState = Object.assign({}, state, { key: value }); return updatedState;
to update the state from a reducer.
The reason for this is that the referred object might be removed/changed while you are in the reducer and this might cause bugs.
Thanks for the tip. We're currently refactoring the code, will keep that in mind
https://github.com/cannc4/Siren/blob/7fcf5a4a285dc246b9f8c50c4a853d58d0273308/src/reducers/user.js#L6
You should use
to update the state from a reducer.
The reason for this is that the referred object might be removed/changed while you are in the reducer and this might cause bugs.