Skip to content

Commit f1a92a3

Browse files
committed
Improve sideUpdate
1 parent d57134b commit f1a92a3

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -343,18 +343,16 @@ function sideUpdate(outputs: any, dispatch: any) {
343343
let componentId, propName;
344344
if (id.includes('.')) {
345345
[componentId, propName] = id.split('.');
346-
if (componentId.startsWith('{')) {
347-
componentId = JSON.parse(componentId);
348-
}
349-
dispatch(updateComponent(componentId, {[propName]: value}));
350346
} else {
351-
if (id.startsWith('{')) {
352-
componentId = JSON.parse(id);
353-
} else {
354-
componentId = id;
355-
}
356-
dispatch(updateComponent(componentId, value));
347+
componentId = id;
348+
}
349+
350+
if (componentId.startsWith('{')) {
351+
componentId = JSON.parse(componentId);
357352
}
353+
354+
const props = propName ? {[propName]: value} : value;
355+
dispatch(updateComponent(componentId, props));
358356
});
359357
}
360358

0 commit comments

Comments
 (0)