Refactor combineReduer's Unexpected State Shape Warning#1118
Refactor combineReduer's Unexpected State Shape Warning#1118ellbee merged 1 commit intoreduxjs:masterfrom
Conversation
b88deec to
5bce135
Compare
|
This looks good to me. 👍 for using |
|
Someone else should review this too, though, since I'm not as familiar with this module. |
src/utils/combineReducers.js
Outdated
There was a problem hiding this comment.
The argument should probably be called reducers, not reducer.
|
I think @ellbee should remember this better than me. |
|
I have just been playing with this, and I am pretty sure that this behaves the same as what is currently there. |
|
Leaving this for you to review then 👍 |
The shape of the previous state is irrelevant, what we’re actually testing is that state has the same shape as our reducer object `finalReducers`. Also fixes the algorithm to be O(n) by using `#hasOwnProperty` vs doing an array search.
5bce135 to
e5aabde
Compare
|
So, the changes in this PR are passing the finalReducer instead of outputState, the switch to |
…hape Refactor combineReduer's Unexpected State Shape Warning
|
Out in 3.0.6, thanks! |
The shape of the previous state is irrelevant, what we’re actually
testing is that state has the same shape as our reducer object
finalReducers.Also fixes the algorithm to be O(n) by using
#hasOwnPropertyvs doingan array search O(n2).