Closed
Description
It would be nice to have an optional predicate function to pass to the connect function, so we can do the usual further immutable data optimizations.
Something like this:
function connect(mapStateToProps, mapDispatchToProps, mergeProps, updateComponent, options = {})
....
const defaultUpdateComponent = (prevStoreState, storeState) => prevStoreState !== storeState;
const finalUpdateComponent = updateComponent || defaultUpdateComponent;
then in handleChange:
handleChange() {
....
if (!pure || finalUpdateComponent(prevStoreState, storeState)) {
this.hasStoreStateChanged = true
this.setState({ storeState })
}
}
P.D.: Happy New Year!
Metadata
Metadata
Assignees
Labels
No labels