etr2460 commented on a change in pull request #10264:
URL: 
https://github.com/apache/incubator-superset/pull/10264#discussion_r451904523



##########
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:
       is there a reason why we want to do mutation here? Unless it's going to 
have perf issues, i'd much prefer this function to return a new object and use 
immutable objects instead of mutating in place




----------------------------------------------------------------
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]

Reply via email to