@proxydi/react
Version:
React wrapper for the ProxyDi library
13 lines (12 loc) • 525 B
TypeScript
import { DependencyId } from 'proxydi';
/**
* Resolves a dependency from the ProxyDi container. A wrapper for the ProxyDiContainer.resolve() method.
*
* @template T - The type of the dependency to resolve.
* @param {DependencyId} dependencyId - Identifier for the dependency.
* @returns {T} The resolved dependency instance.
*
* @throws {Error} If dependency ID is unknown.
* @throws {Error} If the hook is used outside of a ProxyDiProvider.
*/
export declare const useProxyDi: <T>(dependencyId: DependencyId) => T;