File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
import { DashRenderer } from './DashRenderer' ;
2
+ import './utils/setProps' ;
2
3
3
4
// make DashRenderer globally available
4
5
window . DashRenderer = DashRenderer ;
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ import loadingMap from './observers/loadingMap';
15
15
import prioritizedCallbacks from './observers/prioritizedCallbacks' ;
16
16
import requestedCallbacks from './observers/requestedCallbacks' ;
17
17
import storedCallbacks from './observers/storedCallbacks' ;
18
- import setProps from './observers/setProps' ;
19
18
20
19
export interface IStoreState {
21
20
callbacks : ICallbacksState ;
@@ -52,12 +51,13 @@ export default class RendererStore {
52
51
observe ( executingCallbacks ) ;
53
52
observe ( executedCallbacks ) ;
54
53
observe ( storedCallbacks ) ;
55
- observe ( setProps ) ;
56
54
} ) ;
57
55
58
56
private createAppStore = ( reducer : any , middleware : any ) => {
59
57
this . __store = createStore ( reducer , middleware ) ;
60
58
this . storeObserver . setStore ( this . __store ) ;
59
+ const ds = ( window . dash_stores = window . dash_stores || [ ] ) ;
60
+ ds . push ( this . __store ) ;
61
61
this . setObservers ( ) ;
62
62
} ;
63
63
Original file line number Diff line number Diff line change 1
1
import { updateProps , notifyObservers } from '../actions/index' ;
2
+ import { getPath } from '../actions/paths' ;
2
3
3
- const makeSetProps = ( { dispatch, getState} ) => {
4
- const setProps = ( updates : { } ) => {
4
+ const setProps = ( updates : { } ) => {
5
+ const ds = ( window . dash_stores = window . dash_stores || [ ] ) ;
6
+ for ( let y = 0 ; y < ds . length ; y ++ ) {
7
+ const { dispatch, getState} = ds [ y ] ;
5
8
const { paths} = getState ( ) ;
6
9
Object . entries ( updates ) . forEach ( ( [ componentId , props ] ) => {
7
- const componentPath = paths . strs [ componentId ] ;
10
+ const componentPath = getPath ( paths , componentId ) ;
8
11
dispatch (
9
12
updateProps ( {
10
13
props,
@@ -13,10 +16,8 @@ const makeSetProps = ({dispatch, getState}) => {
13
16
) ;
14
17
dispatch ( notifyObservers ( { id : componentId , props} ) ) ;
15
18
} ) ;
16
- } ;
17
-
18
- window . dash_clientside = window . dash_clientside || { } ;
19
- window . dash_clientside [ 'setProps' ] = setProps ;
19
+ }
20
20
} ;
21
21
22
- export default makeSetProps ;
22
+ const dc = ( window . dash_clientside = window . dash_clientside || { } ) ;
23
+ dc [ 'setProps' ] = setProps ;
You can’t perform that action at this time.
0 commit comments