Skip to content

Commit faa98b0

Browse files
Julien HellerNoNameProvided
authored andcommitted
Define abstract AsyncInitializedService class
1 parent 8908613 commit faa98b0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/types/AsyncInitializedService.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Extend when declaring a service with asyncInitialization: true flag.
3+
*/
4+
export abstract class AsyncInitializedService {
5+
public _initialized: Promise<any>;
6+
7+
constructor() {
8+
this._initialized = this.initialize();
9+
}
10+
11+
protected abstract initialize(): Promise<any>;
12+
}

0 commit comments

Comments
 (0)