ktmud commented on a change in pull request #10264:
URL:
https://github.com/apache/incubator-superset/pull/10264#discussion_r451906270
##########
File path: superset-frontend/src/explore/controlUtils.js
##########
@@ -88,15 +88,17 @@ export const getControlConfig = memoizeOne(function
getControlConfig(
return control?.config || control;
});
-export function applyMapStateToPropsToControl(control, state) {
- if (control.mapStateToProps) {
- const appliedControl = { ...control };
- if (state) {
- Object.assign(appliedControl, control.mapStateToProps(state, control));
- }
- return appliedControl;
+/**
+ * Call `mapStateToProps` from controlState and update it in place.
Review comment:
I thought there was merit to update this in place because once a state
is updated, it should never be reused. Mutation makes sure we are always
referring to the same state.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]