@apiratorjs/di-container
Version:
A lightweight dependency injection container for JavaScript and TypeScript with powerful features: modular organization with DiModule.create, lazy initialization, automatic circular dependency detection, and multiple service lifecycles (singleton with bot
25 lines • 835 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DiContainer = void 0;
class DiContainer {
constructor(_diConfigurator) {
this._diConfigurator = _diConfigurator;
}
async resolve(token) {
return await this._diConfigurator.resolve(token);
}
async runWithNewRequestScope(initialStore, callback) {
return await this._diConfigurator.runWithNewRequestScope(initialStore, () => callback(this));
}
isInRequestScopeContext() {
return this._diConfigurator.isInRequestScopeContext();
}
async dispose() {
await this._diConfigurator.disposeSingletons();
}
getRequestScopeContext() {
return this._diConfigurator.getRequestScopeContext();
}
}
exports.DiContainer = DiContainer;
//# sourceMappingURL=di-container.js.map