tsbase
Version:
Base class libraries for TypeScript
20 lines • 649 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Container = void 0;
var Container = /** @class */ (function () {
function Container() {
this.dependencies = null;
}
Container.prototype.Init = function (t) {
this.dependencies = t;
};
Container.prototype.Get = function (dependency) {
if (this.dependencies === null) {
throw new Error('IOC container not yet initialized. Call Init() before Get().');
}
return dependency(this.dependencies);
};
return Container;
}());
exports.Container = Container;
//# sourceMappingURL=Container.js.map