UNPKG

tsbase

Version:

Base class libraries for TypeScript

19 lines 523 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Container = void 0; class Container { constructor() { this.dependencies = null; } Init(t) { this.dependencies = t; } Get(dependency) { if (this.dependencies === null) { throw new Error('IOC container not yet initialized. Call Init() before Get().'); } return dependency(this.dependencies); } } exports.Container = Container; //# sourceMappingURL=Container.js.map