cannc4/Siren

Do not use passed parameter 'state' directly.

doguhanokumus opened this issue · 1 comments

const s = state;

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