UNPKG

react-obsidian

Version:

Dependency injection framework for React and React Native applications

22 lines 936 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.injectComponent = void 0; const ComponentInjector_1 = __importDefault(require("./ComponentInjector")); const componentInjector = new ComponentInjector_1.default(); const injectComponent = (Target, Graph) => { assertGraph(Graph, Target); return componentInjector.inject(Target, Graph); }; exports.injectComponent = injectComponent; function assertGraph(Graph, Target) { if (!Graph) { throw new Error(`injectComponent was called with an undefined Graph.` + `This is probably not an issue with Obsidian.` + `It's typically caused by circular dependencies.` + ` Check the implementation of ${Target.name}.`); } } //# sourceMappingURL=InjectComponent.js.map