captbaritone / raven-for-redux

A Raven middleware for Redux
295 stars 25 forks source link

Add note about mutating data to documentation #7

Closed captbaritone closed 7 years ago

captbaritone commented 7 years ago

As @ChrisSargent found in #5, it's very easy to accidentally mutate an object in one of our optional transform functions. This can lead to very confusing bugs. We could help avoid this by adding a reminder in our documentation.

captbaritone commented 7 years ago

This is probably not so important any more. After merging #8, the action and state are only ever transformed once, when the error is reported.

ChrisSargent commented 7 years ago

True, but is it possible it might not be an app-crashing error and therefore it would still be best to not mutate the state? I think a simple 'Remember not to mutate your state here, if your state will continue to be used'

captbaritone commented 7 years ago

Good point. Fixed.