Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Remove duplicate imports
  • Loading branch information
lachlancollins committed May 26, 2023
commit 950e86d8556d012d082b97a45681aff819619741
3 changes: 2 additions & 1 deletion packages/query-core/src/queryClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import type {
ResetOptions,
SetDataOptions,
DefaultError,
CancelOptions,
DefaultedQueryObserverOptions,
} from './types'
import type { QueryState } from './query'
import { QueryCache } from './queryCache'
Expand All @@ -33,7 +35,6 @@ import { focusManager } from './focusManager'
import { onlineManager } from './onlineManager'
import { notifyManager } from './notifyManager'
import { infiniteQueryBehavior } from './infiniteQueryBehavior'
import type { CancelOptions, DefaultedQueryObserverOptions } from './types'

// TYPES

Expand Down
21 changes: 11 additions & 10 deletions packages/query-core/src/queryObserver.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import type { DefaultedQueryObserverOptions, DefaultError } from './types'
import {
isServer,
isValidTimeout,
noop,
replaceData,
shallowEqualObjects,
timeUntilStale,
} from './utils'
import { notifyManager } from './notifyManager'
import type {
DefaultedQueryObserverOptions,
DefaultError,
PlaceholderDataFunction,
QueryKey,
QueryObserverBaseResult,
Expand All @@ -17,6 +9,15 @@ import type {
QueryOptions,
RefetchOptions,
} from './types'
import {
isServer,
isValidTimeout,
noop,
replaceData,
shallowEqualObjects,
timeUntilStale,
} from './utils'
import { notifyManager } from './notifyManager'
import type { Query, QueryState, FetchOptions } from './query'
import type { QueryClient } from './queryClient'
import { focusManager } from './focusManager'
Expand Down
3 changes: 1 addition & 2 deletions packages/query-core/src/tests/queryCache.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { sleep, queryKey, createQueryClient } from './utils'
import { QueryClient } from '..'
import { QueryCache, QueryObserver } from '..'
import { QueryClient, QueryCache, QueryObserver } from '..'
import { waitFor } from '@testing-library/react'
import { vi } from 'vitest'

Expand Down
3 changes: 1 addition & 2 deletions packages/query-core/src/tests/queryClient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import type {
QueryFunction,
QueryObserverOptions,
} from '..'
import { MutationObserver, QueryObserver } from '..'
import { focusManager, onlineManager } from '..'
import { MutationObserver, QueryObserver, focusManager, onlineManager } from '..'
import { noop } from '../utils'
import { vi } from 'vitest'

Expand Down
3 changes: 1 addition & 2 deletions packages/query-core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* istanbul ignore file */

import type { MutationState } from './mutation'
import type { QueryBehavior, Query } from './query'
import type { FetchDirection, QueryBehavior, Query } from './query'
import type { RetryValue, RetryDelayValue } from './retryer'
import type { QueryFilters, QueryTypeFilter } from './utils'
import type { QueryCache } from './queryCache'
import type { MutationCache } from './mutationCache'
import type { FetchDirection } from './query'

export interface Register {
// defaultError: Error
Expand Down
2 changes: 1 addition & 1 deletion packages/query-devtools/src/Devtools.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { Accessor, Component, JSX, Setter } from 'solid-js'
import { For } from 'solid-js'
import {
createEffect,
createMemo,
createSignal,
on,
onCleanup,
onMount,
For,
Show,
} from 'solid-js'
import { rankItem } from '@tanstack/match-sorter-utils'
Expand Down
2 changes: 1 addition & 1 deletion packages/query-persist-client-core/src/persist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type {
DehydratedState,
DehydrateOptions,
HydrateOptions,
NotifyEventType,
} from '@tanstack/query-core'
import { dehydrate, hydrate } from '@tanstack/query-core'
import type { NotifyEventType } from '@tanstack/query-core'

export type Promisable<T> = T | PromiseLike<T>

Expand Down
5 changes: 1 addition & 4 deletions packages/react-query/src/suspense.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import type { DefaultedQueryObserverOptions } from '@tanstack/query-core'
import type { QueryObserver } from '@tanstack/query-core'
import type { DefaultedQueryObserverOptions, QueryObserverResult, QueryKey, QueryObserver } from '@tanstack/query-core'
import type { QueryErrorResetBoundaryValue } from './QueryErrorResetBoundary'
import type { QueryObserverResult } from '@tanstack/query-core'
import type { QueryKey } from '@tanstack/query-core'

export const ensureStaleTime = (
defaultedOptions: DefaultedQueryObserverOptions<any, any, any, any, any>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { render, screen, waitFor } from '@solidjs/testing-library'
import { queryKey } from './utils'
import { createQueryClient, sleep, queryKey } from './utils'

import { QueryCache } from '@tanstack/query-core'
import { createQuery, QueryClientProvider, useQueryClient } from '..'
import { createQueryClient, sleep } from './utils'
import { vi } from 'vitest'

describe('QueryClientProvider', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { fireEvent, render, screen, waitFor } from '@solidjs/testing-library'

import { createQueryClient, sleep } from './utils'
import { createQueryClient, sleep, Blink, queryKey, setActTimeout } from './utils'

import {
createEffect,
Expand All @@ -23,7 +23,6 @@ import {
QueryClientProvider,
keepPreviousData,
} from '..'
import { Blink, queryKey, setActTimeout } from './utils'
import { vi } from 'vitest'
import type { Mock } from 'vitest'

Expand Down
3 changes: 1 addition & 2 deletions packages/solid-query/src/__tests__/useIsMutating.test.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { fireEvent, render, screen, waitFor } from '@solidjs/testing-library'
import { createMutation, QueryClientProvider, useIsMutating } from '..'
import { createQueryClient, sleep } from './utils'
import { createQueryClient, sleep, setActTimeout } from './utils'

import { createEffect, createRenderEffect, createSignal, Show } from 'solid-js'
import * as MutationCacheModule from '../../../query-core/src/mutationCache'
import { setActTimeout } from './utils'
import { vi } from 'vitest'

describe('useIsMutating', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/solid-query/src/createBaseQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import type {
QueryObserverResult,
} from '@tanstack/query-core'
import type { QueryClient } from './QueryClient'
import { hydrate } from '@tanstack/query-core'
import { notifyManager } from '@tanstack/query-core'
import { hydrate, notifyManager } from '@tanstack/query-core'
import type { Accessor } from 'solid-js'
import { isServer } from 'solid-js/web'
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-query/src/useMutationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import type {
MutationFilters as MF,
Mutation,
DefaultError,
MutationState,
} from '@tanstack/query-core'
import type { MutationState } from '@tanstack/query-core'
import { useQueryClient } from './useQueryClient'
import { cloneDeepUnref } from './utils'
import type { QueryClient } from './queryClient'
Expand Down
4 changes: 2 additions & 2 deletions packages/vue-query/src/useQueries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import type {
QueriesPlaceholderDataFunction,
QueryKey,
QueriesObserverOptions,
QueryFunction,
QueryObserverResult,
} from '@tanstack/query-core'
import type { Ref } from 'vue-demi'
import { computed, onScopeDispose, readonly, ref, watch } from 'vue-demi'

import type { QueryFunction, QueryObserverResult } from '@tanstack/query-core'

import { useQueryClient } from './useQueryClient'
import { cloneDeepUnref } from './utils'
import type { UseQueryOptions } from './useQuery'
Expand Down