Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
🔨 Filter changed props that are not connected to the inputs.
Browse files Browse the repository at this point in the history
  • Loading branch information
T4rk1n committed Feb 14, 2019
1 parent 8136212 commit 0c616dd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
13 changes: 10 additions & 3 deletions dash_renderer/dash_renderer.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -34023,7 +34023,7 @@ function notifyObservers(payload) {
};
}

function updateOutput(outputComponentId, outputProp, getState, requestUid, dispatch, changedProps) {
function updateOutput(outputComponentId, outputProp, getState, requestUid, dispatch, changedPropIds) {
var _getState3 = getState(),
config = _getState3.config,
layout = _getState3.layout,
Expand All @@ -34043,8 +34043,7 @@ function updateOutput(outputComponentId, outputProp, getState, requestUid, dispa
*/

var payload = {
output: { id: outputComponentId, property: outputProp },
changedProps: changedProps
output: { id: outputComponentId, property: outputProp }
};

var _dependenciesRequest$ = dependenciesRequest.content.find(function (dependency) {
Expand All @@ -34068,6 +34067,14 @@ function updateOutput(outputComponentId, outputProp, getState, requestUid, dispa
};
});

var inputsPropIds = payload.inputs.map(function (p) {
return p.id + '.' + p.property;
});

payload.changedPropIds = changedPropIds.filter(function (p) {
return (0, _ramda.contains)(p, inputsPropIds);
});

if (state.length > 0) {
payload.state = state.map(function (stateObject) {
// Make sure the component id exists in the layout
Expand Down
2 changes: 1 addition & 1 deletion dash_renderer/dash_renderer.dev.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_renderer/dash_renderer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_renderer/dash_renderer.min.js.map

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions src/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function updateOutput(
getState,
requestUid,
dispatch,
changedProps,
changedPropIds,
) {
const {config, layout, graphs, paths, dependenciesRequest} = getState();
const {InputGraph} = graphs;
Expand All @@ -373,7 +373,6 @@ function updateOutput(
*/
const payload = {
output: {id: outputComponentId, property: outputProp},
changedProps
};

const {inputs, state} = dependenciesRequest.content.find(
Expand Down Expand Up @@ -409,6 +408,12 @@ function updateOutput(
};
});

const inputsPropIds = payload.inputs.map(p => `${p.id}.${p.property}`);

payload.changedPropIds = changedPropIds.filter(
p => contains(p, inputsPropIds)
);

if (state.length > 0) {
payload.state = state.map(stateObject => {
// Make sure the component id exists in the layout
Expand Down

0 comments on commit 0c616dd

Please sign in to comment.