Skip to content

Commit

Permalink
chore(base): fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoerge committed Mar 24, 2021
1 parent 7f9cf6d commit 307f8c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/@sanity/base/src/datastores/document/listenQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import {mergeMap, throttleTime, share, switchMapTo, take} from 'rxjs/operators'

import {ReconnectEvent, WelcomeEvent} from './types'

const fetch = (query: string, params: {}) => defer(() => client.observable.fetch(query, params))
type Params = Record<string, string>

const listen = (query: string, params: {}) =>
const fetch = (query: string, params: Params) => defer(() => client.observable.fetch(query, params))

const listen = (query: string, params: Params) =>
defer(() =>
client.listen(query, params, {
events: ['welcome', 'mutation', 'reconnect'],
Expand All @@ -23,7 +25,7 @@ function isWelcomeEvent(

// todo: promote as building block for better re-use
// todo: optimize by patching collection in-place
export const listenQuery = (query: string, params: {}) => {
export const listenQuery = (query: string, params: Params = {}) => {
const fetchOnce$ = fetch(query, params)

const events$ = listen(query, params).pipe(
Expand Down

2 comments on commit 307f8c5

@vercel
Copy link

@vercel vercel bot commented on 307f8c5 Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

test-studio – ./

test-studio.sanity.build
test-studio-git-next.sanity.build

@vercel
Copy link

@vercel vercel bot commented on 307f8c5 Mar 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

perf-studio – ./

perf-studio.sanity.build
perf-studio-git-next.sanity.build

Please sign in to comment.