Skip to content

Commit

Permalink
chore(sanity): rename getPairListener => createPairListener
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed May 8, 2024
1 parent e64c3f7 commit 7e4940f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function allPendingTransactionEventsReceived(listenerEvents: ListenerEvent[]) {
}

/** @internal */
export function getPairListener(
export function createPairListener(
client: SanityClient,
idPair: IdPair,
options: PairListenerOptions = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -201,7 +201,7 @@ export function checkoutPair(
const {publishedId, draftId} = idPair

const listenerEventsConnector = new Subject<ListenerEvent>()
const listenerEvents$ = getPairListener(client, idPair).pipe(
const listenerEvents$ = createPairListener(client, idPair).pipe(
share({connector: () => listenerEventsConnector}),
)

Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/core/store/_legacy/document/index.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down

0 comments on commit 7e4940f

Please sign in to comment.