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

Interface: AsyncNamespace ​

Defined in: src/types.ts:439

Stands for a namespace of an AsyncDIContainer in a service map: get('Name') resolves to an AsyncServiceProvider of its services.

Example ​

ts
const app = new AsyncDIContainer().namespace('Billing', (b) => b.addInstance('currency', 'EUR'));

type Services = ContainerServices<typeof app>; // { Billing: AsyncNamespace; 'Billing.currency': string }
await app.get('Billing'); // AsyncServiceProvider<{ currency: string }>

Properties ​

[namespaceBrand] ​

readonly [namespaceBrand]: "async"

Defined in: src/types.ts:440

Released under the MIT License.