UNPKG

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

16 lines (12 loc) 464 B
import {useMemo} from 'react' import {useObservable} from 'react-rx' import {useDocumentStore} from '../store' /** @internal */ export function useDocumentOperationEvent(publishedDocId: string, docTypeName: string) { const documentStore = useDocumentStore() const observable = useMemo( () => documentStore.pair.operationEvents(publishedDocId, docTypeName), [docTypeName, documentStore.pair, publishedDocId], ) return useObservable(observable) }