redux-devtools
redux-devtools copied to clipboard
When there is no state, show previous state?
If the reducer throws for every action, getState() visible to the app will return undefined with DevTools enabled (which will display the error). This usually blows up the app badly because all kinds of store.subscribe() calls expect state to at least be there.
I propose to cache the last non-undefined state, and in the event that the current state is undefined because reducer error'd, return the last non-undefined state. Thoughts?
This seems reasonable to me, and better than the current behaviour. I'm going to write some tests for #9, and after that I'm going to try implementing this.
Done in 2.1.4.