File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 7878 "redux" : " ^3.5.2" ,
7979 "redux-devtools" : " ^3.3.1" ,
8080 "redux-devtools-instrument" : " ^1.3.3" ,
81- "remotedev-app" : " ^0.10.0 " ,
81+ "remotedev-app" : " ^0.10.1 " ,
8282 "remotedev-monitor-components" : " ^0.0.4" ,
8383 "remotedev-slider" : " ^1.1.1" ,
8484 "remotedev-utils" : " 0.0.1"
Original file line number Diff line number Diff line change 11import jsan from 'jsan' ;
2+ import importState from './importState' ;
23
34const listeners = { } ;
45export const source = '@devtools-page' ;
@@ -78,6 +79,14 @@ function handleMessages(event) {
7879 if ( ! message || message . source !== '@devtools-extension' ) return ;
7980 Object . keys ( listeners ) . forEach ( id => {
8081 if ( message . id && id !== message . id ) return ;
82+ if ( message . type === 'IMPORT' ) {
83+ message . type = 'DISPATCH' ;
84+ message . payload = {
85+ type : 'IMPORT_STATE' ,
86+ ...importState ( message . state , { } )
87+ } ;
88+ message . state = undefined ;
89+ }
8190 if ( typeof listeners [ id ] === 'function' ) listeners [ id ] ( message ) ;
8291 else listeners [ id ] . forEach ( fn => { fn ( message ) ; } ) ;
8392 } ) ;
Original file line number Diff line number Diff line change @@ -139,7 +139,8 @@ describe('Redux enhancer', () => {
139139 source : '@devtools-extension'
140140 } , '*' ) ;
141141 } ) ;
142- expect ( message . type ) . toBe ( 'IMPORT' ) ;
142+ expect ( message . type ) . toBe ( 'DISPATCH' ) ;
143+ expect ( message . payload . type ) . toBe ( 'IMPORT_STATE' ) ;
143144 message = await listenMessage ( ) ;
144145 expect ( message . type ) . toBe ( 'STATE' ) ;
145146 expect ( window . store . getState ( ) ) . toBe ( 2 ) ;
You can’t perform that action at this time.
0 commit comments