Hi,
I'm considering doing something to prevent bad state mutations. The first thing that I though about was immutable but then I started to think about the potential performance implications.
Some immutable checks will decrease performance because they are adding some run-time overhead. At the same time using immutable could improve performance when used in places like shouldComponentUpdate:
shouldComponentUpdate: function(nextProps, nextState) {
return this.props.value !== nextProps.value;
}
So my main question are:
- Should I use immutable data structures?
- Should I use immutable data structures in production?
- Is the redux-immutable-state-invariant middleware a good alternative?
I was also trying to find out how to integrate immutable.js with Redux and I found two libraries:
Both libraries force you to use their custom implementation of combineReducers but there seems to be some problems with the reducers and middle-ware.
I have seem examples that use Redux + immutable.js without redux-immutable or redux-immutablejs so I'm not fully sure about those being really needed.
Hi,
I'm considering doing something to prevent bad state mutations. The first thing that I though about was immutable but then I started to think about the potential performance implications.
Some immutable checks will decrease performance because they are adding some run-time overhead. At the same time using immutable could improve performance when used in places like
shouldComponentUpdate:So my main question are:
I was also trying to find out how to integrate immutable.js with Redux and I found two libraries:
Both libraries force you to use their custom implementation of
combineReducersbut there seems to be some problems with the reducers and middle-ware.I have seem examples that use Redux + immutable.js without
redux-immutableorredux-immutablejsso I'm not fully sure about those being really needed.