Documents injecute 1.x · Migrating from 0.x
Skip to content

Variable: AsyncDIContainer ​

AsyncDIContainer: {new (): AsyncDIContainer<{ }>; prototype: AsyncDIContainer<any>; }

Defined in: src/async-container.ts:108

Creates an AsyncDIContainer. Forks keep the async behaviour, and container instanceof AsyncDIContainer works.

Type Declaration ​

Returns ​

AsyncDIContainer<{ }>

prototype ​

readonly prototype: AsyncDIContainer<any>

Example ​

ts
const app = new AsyncDIContainer().addSingleton('db', () => connect(url));
const db = await app.get('db');

Released under the MIT License.