react-obsidian
Version:
Dependency injection framework for React and React Native applications
20 lines • 1.07 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.injectHookWithArguments = injectHookWithArguments;
exports.injectHook = injectHook;
const HookInjector_1 = __importDefault(require("./HookInjector"));
const hookInjector = new HookInjector_1.default();
// TypeScript doesn't infer generics when default types are passed in. - https://github.com/microsoft/TypeScript/issues/14400
// As a workaround, we provide two injection functions with an almost identical signature.
// 1. injectHookWithArguments: Should be used when a hook requires parameters in addition to the injected dependencies.
// 2. injectHook: Should be used when a hook does not require parameters.
function injectHookWithArguments(hook, keyOrGraph) {
return hookInjector.inject(hook, keyOrGraph);
}
function injectHook(hook, keyOrGraph) {
return hookInjector.inject(hook, keyOrGraph);
}
//# sourceMappingURL=InjectHook.js.map