File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -498,11 +498,11 @@ export class ContainerInstance {
498498
499499 if ( value instanceof AsyncInitializedService || service . asyncInitialization ) {
500500 return new Promise ( ( resolve ) => {
501- if ( ! ( value . _initialized instanceof Promise ) && service . asyncInitialization ) {
501+ if ( ! ( value . initialized instanceof Promise ) && service . asyncInitialization ) {
502502 throw new MissingInitializedPromiseError ( service . value ) ;
503503 }
504-
505- value . _initialized . then ( ( ) => resolve ( value ) ) ;
504+
505+ value . initialized . then ( ( ) => resolve ( value ) ) ;
506506 } ) ;
507507 }
508508 return Promise . resolve ( value ) ;
Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ export class MissingInitializedPromiseError extends Error {
66
77 constructor ( value : any ) {
88 super (
9- ( value . _initialized
10- ? `asyncInitialization: true was used, but ${ value . name } #_initialized is not a Promise. `
11- : `asyncInitialization: true was used, but ${ value . name } #_initialized is undefined. ` ) +
9+ ( value . initialized
10+ ? `asyncInitialization: true was used, but ${ value . name } #initialized is not a Promise. `
11+ : `asyncInitialization: true was used, but ${ value . name } #initialized is undefined. ` ) +
1212 `You will need to either extend the abstract AsyncInitializedService class, or assign ` +
13- `${ value . name } #_initialized to a Promise in your class' constructor that resolves when all required ` +
13+ `${ value . name } #initialized to a Promise in your class' constructor that resolves when all required ` +
1414 `initialization is complete.`
1515 ) ;
1616 Object . setPrototypeOf ( this , MissingInitializedPromiseError . prototype ) ;
Original file line number Diff line number Diff line change 22 * Extend when declaring a service with asyncInitialization: true flag.
33 */
44export abstract class AsyncInitializedService {
5- public _initialized : Promise < any > ;
5+ public initialized : Promise < any > ;
66
77 constructor ( ) {
8- this . _initialized = this . initialize ( ) ;
8+ this . initialized = this . initialize ( ) ;
99 }
1010
1111 protected abstract initialize ( ) : Promise < any > ;
You can’t perform that action at this time.
0 commit comments