* Initialize the application, and all of its registered observers. The * application state is checked to ensure the integrity of `initialize`. * * If the application is already initialized, no operation is performed. * * This method is automatically invoked by `start()` if the applica
()
| 309 | * initialized. |
| 310 | */ |
| 311 | public async init(): Promise<void> { |
| 312 | if (this._initialized) return; |
| 313 | if (this._state === 'initializing') return this.awaitState('initialized'); |
| 314 | this.assertNotInProcess('initialize'); |
| 315 | this.setState('initializing'); |
| 316 | |
| 317 | const registry = await this.getLifeCycleObserverRegistry(); |
| 318 | await registry.init(); |
| 319 | this._initialized = true; |
| 320 | this.setState('initialized'); |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Register a function to be called when the application initializes. |
no test coverage detected