We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8878f6 commit 761c5adCopy full SHA for 761c5ad
src/types/AsyncInitializedService.ts
@@ -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