sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
18 lines (13 loc) • 413 B
text/typescript
import {useContext} from 'react'
import {
DocumentChangeContext,
type DocumentChangeContextInstance,
} from '../contexts/DocumentChangeContext'
/** @internal */
export function useDocumentChange(): DocumentChangeContextInstance {
const documentChange = useContext(DocumentChangeContext)
if (!documentChange) {
throw new Error('DocumentChange: missing context value')
}
return documentChange
}