reactjs/redux includes a check to ensure that only plain objects can be dispatched. I recall hearing, in a podcast interview, Dan Abramov give his definition of Redux, and that definition included the ability to use time-travel debugging — with the Redux DevTools. So time-travel debugging is a fundamental Redux feature.

Unfortunately, Medium does not appear to allow strikethrough to be used. Pretty much everything beneath this is wrong. Read the response, instead.

With the Redux Chrome DevTools extension, actions are serialized to JSON as part of the communication between the page and the extension. Clearly, if something other than a plain object is serialized and then deserialized, what you end up with is not what you started with. Whether or not this is a problem depends upon what you are expecting.

NgRx does not include a check for plain objects and it’s certainly possible to use actions that are class instances without problems — with the Redux DevTools extension — as long as you are not relying on instanceof or non-serializable properties or methods, you will be fine.

I look at the decision to allow only plain objects in reactjs/redux as a defensive one. If you are limited to only dispatching plain objects, your reducers will always receive what was dispatched. If, however, you are able to dispatch class instances, you might sometimes receive something different to what was dispatched.

The Redux documentation mentions that state should be serializable as JSON.

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store