diff --git a/packages/sanity/src/core/store/_legacy/document/buffered-doc/createBufferedDocument.ts b/packages/sanity/src/core/store/_legacy/document/buffered-doc/createBufferedDocument.ts index 3300568c2bca..17b20f9c5cb1 100644 --- a/packages/sanity/src/core/store/_legacy/document/buffered-doc/createBufferedDocument.ts +++ b/packages/sanity/src/core/store/_legacy/document/buffered-doc/createBufferedDocument.ts @@ -1,7 +1,7 @@ import {type SanityDocument} from '@sanity/types' import {type Observable} from 'rxjs' -import {type ListenerEvent} from '../getPairListener' +import {type ListenerEvent} from '../createPairListener' import { type CommitRequest, createObservableBufferedDocument, diff --git a/packages/sanity/src/core/store/_legacy/document/buffered-doc/createObservableBufferedDocument.ts b/packages/sanity/src/core/store/_legacy/document/buffered-doc/createObservableBufferedDocument.ts index 431b12bab3c5..acfccc704836 100644 --- a/packages/sanity/src/core/store/_legacy/document/buffered-doc/createObservableBufferedDocument.ts +++ b/packages/sanity/src/core/store/_legacy/document/buffered-doc/createObservableBufferedDocument.ts @@ -15,7 +15,7 @@ import { withLatestFrom, } from 'rxjs/operators' -import {type ListenerEvent} from '../getPairListener' +import {type ListenerEvent} from '../createPairListener' import {type MutationEvent} from '../types' import { type DocumentMutationEvent, diff --git a/packages/sanity/src/core/store/_legacy/document/getPairListener.ts b/packages/sanity/src/core/store/_legacy/document/createPairListener.ts similarity index 99% rename from packages/sanity/src/core/store/_legacy/document/getPairListener.ts rename to packages/sanity/src/core/store/_legacy/document/createPairListener.ts index d97af20f586a..aa55c9230178 100644 --- a/packages/sanity/src/core/store/_legacy/document/getPairListener.ts +++ b/packages/sanity/src/core/store/_legacy/document/createPairListener.ts @@ -59,7 +59,7 @@ function allPendingTransactionEventsReceived(listenerEvents: ListenerEvent[]) { } /** @internal */ -export function getPairListener( +export function createPairListener( client: SanityClient, idPair: IdPair, options: PairListenerOptions = {}, diff --git a/packages/sanity/src/core/store/_legacy/document/document-pair/checkoutPair.ts b/packages/sanity/src/core/store/_legacy/document/document-pair/checkoutPair.ts index 114abf5a7d8a..d8bccd7d2a92 100644 --- a/packages/sanity/src/core/store/_legacy/document/document-pair/checkoutPair.ts +++ b/packages/sanity/src/core/store/_legacy/document/document-pair/checkoutPair.ts @@ -11,7 +11,7 @@ import { type MutationPayload, type RemoteSnapshotEvent, } from '../buffered-doc' -import {getPairListener, type ListenerEvent} from '../getPairListener' +import {createPairListener, type ListenerEvent} from '../createPairListener' import {type IdPair, type PendingMutationsEvent, type ReconnectEvent} from '../types' import {type HttpAction} from './actionTypes' @@ -201,7 +201,7 @@ export function checkoutPair( const {publishedId, draftId} = idPair const listenerEventsConnector = new Subject() - const listenerEvents$ = getPairListener(client, idPair).pipe( + const listenerEvents$ = createPairListener(client, idPair).pipe( share({connector: () => listenerEventsConnector}), ) diff --git a/packages/sanity/src/core/store/_legacy/document/index.ts b/packages/sanity/src/core/store/_legacy/document/index.ts index b4c15fe42ae5..184b8704c25b 100644 --- a/packages/sanity/src/core/store/_legacy/document/index.ts +++ b/packages/sanity/src/core/store/_legacy/document/index.ts @@ -1,7 +1,7 @@ export * from './buffered-doc' +export * from './createPairListener' export * from './document-pair' export * from './document-store' -export * from './getPairListener' export * from './hooks' export * from './initialValue' export * from './listenQuery'