4 ms·
combineReducers is for taking plain objects and returning another plain object. With immutable you need to either write your own combineReducers or use one that
by jonesetc 11y ago
combineReducers is for taking plain objects and returning another plain object. With immutable you need to either write your own combineReducers or use one that someone else has made that taks immutable objects and returns an immutable object.
- darklajid 11y agoWait - we're talking about the result of the combination? If you follow a 'get started with redux' thing and end up with a root reducer that uses combineReducers: You're talking about the outermost 'state' object? Because any reducer that you write can certainly accept/understand/return immutables, right? If I picked that up correctly: Is that a problem for a single combineReducers at the root? Because if all the properties of that thing are immutable, wouldn't you get the cheap identity based comparison benefits whenever you pass on props.foo in your store-aware component?
- danmaz74 11y agoYes, it's the actual combiner that can't create an Immutable object.