eadmundo / redux-seamless-immutable

Helpers for using seamless-immutable in Redux
MIT License
46 stars 11 forks source link

Make combineReducers idempotent #4

Closed chadly closed 8 years ago

chadly commented 8 years ago

I've been using your library for a little while now in combination with reselect and have really found it useful. However, I noticed after a little while that my reselect selectors were firing for different parts of the state tree even though those parts did not change. I investigated a little bit and found that the combineReducers here is returning a new Immutable object no matter what the child reducers are doing.

I added a test case to illustrate what is happening and updated the implementation to not unnecessarily create new Immutable objects. For my code, this has improved performance since, given an action, my selectors only fire for the part of the state tree that is different.

eadmundo commented 8 years ago

Thanks @chadly - merged & published new version to npm. Appreciate the fix!