mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-23 05:24:18 +00:00
14 lines
377 B
JavaScript
14 lines
377 B
JavaScript
import { useContext } from "react"
|
|
import ContextRepositoryViewer from "../contexts/ContextRepositoryViewer"
|
|
|
|
|
|
/**
|
|
* @todo Document this.
|
|
*/
|
|
export default function useRepositoryViewer() {
|
|
const context = useContext(ContextRepositoryViewer)
|
|
if(!context) {
|
|
throw new Error("This component must be placed inside a RepositoryViewer.")
|
|
}
|
|
return context
|
|
}
|