Skip to content

Commit 38f5bb2

Browse files
Julien HellerNoNameProvided
authored andcommitted
Remove leading _ as it's not private
1 parent c348345 commit 38f5bb2

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/container-instance.class.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

src/error/MissingInitializedPromiseError.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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);

src/types/AsyncInitializedService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* Extend when declaring a service with asyncInitialization: true flag.
33
*/
44
export 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>;

0 commit comments

Comments
 (0)