Skip to content

Commit 78ccd87

Browse files
committed
migrating setProps to be a util that gets imported and then created with createAppStore
1 parent 647ee9f commit 78ccd87

File tree

2 files changed

+22
-30
lines changed

2 files changed

+22
-30
lines changed

dash/dash-renderer/src/observers/setProps.ts

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {updateProps, notifyObservers} from '../actions/index';
2+
3+
const makeSetProps = ({dispatch, getState}) => {
4+
const setProps = (updates: {}) => {
5+
const {paths} = getState();
6+
Object.entries(updates).forEach(([componentId, props]) => {
7+
const componentPath = paths.strs[componentId];
8+
dispatch(
9+
updateProps({
10+
props,
11+
itempath: componentPath
12+
})
13+
);
14+
dispatch(notifyObservers({id: componentId, props}));
15+
});
16+
};
17+
18+
window.dash_clientside = window.dash_clientside || {};
19+
window.dash_clientside['setProps'] = setProps;
20+
};
21+
22+
export default makeSetProps;

0 commit comments

Comments
 (0)