File tree Expand file tree Collapse file tree 3 files changed +13
-18
lines changed
packages/redux-devtools-cli/src Expand file tree Collapse file tree 3 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export function inject(
5656 startFlag ,
5757 ' require("' + name + '")(' + JSON . stringify ( options ) + ')' ,
5858 ' .then(_remotedev =>' ,
59- ' _remotedev.on(" ready", () => {' ,
59+ ' _remotedev.ready.then( () => {' ,
6060 ' if (!_remotedev.portAlreadyUsed) console.log("-".repeat(80));' ,
6161 ' ' + serverFlag ,
6262 ' })' ,
Original file line number Diff line number Diff line change @@ -87,10 +87,8 @@ if (argv.injectserver) {
8787 ) ;
8888}
8989
90- // eslint-disable-next-line @typescript-eslint/no-floating-promises
91- server ( argv ) . then ( async function ( r ) {
92- if ( argv . open && argv . open !== 'false' ) {
93- await r . listener ( 'ready' ) . once ( ) ;
94- await openApp ( argv . open as string , options ) ;
95- }
96- } ) ;
90+ const response = await server ( argv ) ;
91+ if ( argv . open && argv . open !== 'false' ) {
92+ await response . ready ;
93+ await openApp ( argv . open as string , options ) ;
94+ }
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const LOG_LEVEL_INFO = 3;
1313
1414export default async function ( argv : { [ arg : string ] : any } ) : Promise < {
1515 portAlreadyUsed ?: boolean ;
16- listener : ( eventName : ' ready' ) => { once ( ) : Promise < void > } ;
16+ ready : Promise < void > ;
1717} > {
1818 const options = Object . assign ( getOptions ( argv ) , {
1919 allowClientPublish : false ,
@@ -29,13 +29,7 @@ export default async function (argv: { [arg: string]: any }): Promise<{
2929 }
3030 return {
3131 portAlreadyUsed : true ,
32- listener : function ( ) {
33- return {
34- once ( ) {
35- return Promise . resolve ( ) ;
36- } ,
37- } ;
38- } ,
32+ ready : Promise . resolve ( ) ,
3933 } ;
4034 }
4135
@@ -135,6 +129,9 @@ export default async function (argv: { [arg: string]: any }): Promise<{
135129 } ) ( ) ;
136130
137131 httpServer . listen ( options . port ) ;
138- // @ts -expect-error Shouldn't there be a 'ready' event?
139- return agServer ;
132+ return {
133+ ready : ( async ( ) => {
134+ await agServer . listener ( 'ready' as 'error' ) . once ( ) ;
135+ } ) ( ) ,
136+ } ;
140137}
You can’t perform that action at this time.
0 commit comments