sanity-plugin-mux-input
Version:
An input component that integrates Sanity Studio with Mux video encoding/hosting service.
22 lines (18 loc) • 513 B
text/typescript
import {createHookFromObservableFactory, DocumentStore, SanityDocument} from 'sanity'
import {SANITY_API_VERSION} from './useClient'
const useDocReferences = createHookFromObservableFactory<
SanityDocument[],
{
documentStore: DocumentStore
id: string
}
>(({documentStore, id}) => {
return documentStore.listenQuery(
/* groq */ '*[references($id)]{_id, _type, _rev, _updatedAt, _createdAt}',
{id},
{
apiVersion: SANITY_API_VERSION,
}
)
})
export default useDocReferences