()
| 24 | * @throws Error if used outside of AdapterProvider |
| 25 | */ |
| 26 | export function useAdapter(): DocumentAdapter { |
| 27 | const adapter = useContext(AdapterContext); |
| 28 | if (!adapter) { |
| 29 | throw new Error("useAdapter must be used within an AdapterProvider"); |
| 30 | } |
| 31 | return adapter; |
| 32 | } |
| 33 | |
| 34 | /** |
| 35 | * Hook to safely access the document adapter (returns null if not available) |
no outgoing calls
no test coverage detected