Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork3.3k
Closed
Description
It would be nice to have an optional predicate function to pass to the connect function, so we can dothe 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