-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When there is no state, show previous state? #106
Comments
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. |
gaearon
added a commit
that referenced
this issue
Sep 24, 2015
Return last non-undefined state from getState() #106
Done in 2.1.4. |
This was referenced Oct 17, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the reducer throws for every action,
getState()
visible to the app will returnundefined
with DevTools enabled (which will display the error). This usually blows up the app badly because all kinds ofstore.subscribe()
calls expectstate
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?The text was updated successfully, but these errors were encountered: