MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / init

Method init

packages/core/src/application.ts:311–321  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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.

Callers 1

startMethod · 0.95

Calls 5

awaitStateMethod · 0.95
assertNotInProcessMethod · 0.95
setStateMethod · 0.95
initMethod · 0.65

Tested by

no test coverage detected