-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Should combineReducers
return the same object if nothing changes?
#853
Comments
Let's add the check. Something like |
💯 Went through a painful process figuring out why disparate parts of my app were re-rendering. Was about to write my own function when I figured this out, but glad I can update instead. 👍 |
@aaronjensen Can you help me understand the issue here? You're normally interested in only a part of the state that you're combining together. You'd have to have a dependency on the whole combined chunk in order to run into trouble, right? Have you got such usecase really? |
I don’t use redux anymore. This issue is 6 years old. |
I imagine I did have a use case at the time or I would not have opened an issue and submitted a patch. |
Right now, the reducer returned by
combineReducers
returns a new object regardless of whether or not the reducers it is combining make any changes. This means breaking reference equal every action, which limits its usefulness when using nested combinations unless you always select all the way down to the piece of state that maintains reference equality integrity. It'd be a little bit more slow to introduce an equality check, after themapValues
but it seems like it'd be better, yeah?The text was updated successfully, but these errors were encountered: