UNPKG

@blynx/inject

Version:
26 lines (25 loc) 625 B
Object.defineProperty(exports, "__esModule", { value: true }); /** * js-injectable helper * * @export * @class Injector */ class Injector { /** * Instantiate a class decorated with Injectable * * @static * @template T Type of class * @param {{new(...args: any[]): T}} newType The class to instantiate * @param {...any[]} args Arguments, use for excluded injectables * @returns {T} New instance of T * * @memberOf Injector */ static inject(newType, ...args) { var result = new newType(...args); return result; } } exports.Injector = Injector;