Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
aryaemami59 committed Nov 5, 2024
1 parent 98b93e3 commit c84ac4b
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 44 deletions.
18 changes: 11 additions & 7 deletions packages/toolkit/src/entities/tests/state_selectors.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { createDraftSafeSelectorCreator } from '../../createDraftSafeSelector'
import type { EntityAdapter, EntityState } from '../index'
import { createEntityAdapter } from '../index'
import type { EntitySelectors } from '../models'
import type {
EntityAdapter,
EntitySelectors,
EntityState,
Selector,
} from '@reduxjs/toolkit'
import {
createDraftSafeSelectorCreator,
createEntityAdapter,
createSelector,
} from '@reduxjs/toolkit'
import type { BookModel } from './fixtures/book'
import { AClockworkOrange, AnimalFarm, TheGreatGatsby } from './fixtures/book'
import type { Selector } from 'reselect'
import { createSelector, weakMapMemoize } from 'reselect'
import { vi } from 'vitest'

describe('Entity State Selectors', () => {
describe('Composed Selectors', () => {
Expand Down
1 change: 0 additions & 1 deletion packages/toolkit/src/immutableStateInvariantMiddleware.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Middleware } from 'redux'
import type { IgnorePaths } from './serializableStateInvariantMiddleware'
import type { AnyObject } from './tsHelpers'
import { getTimeMeasureUtils } from './utils'

type EntryProcessor = (key: string, value: any) => any
Expand Down
17 changes: 10 additions & 7 deletions packages/toolkit/src/listenerMiddleware/tests/fork.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import type { EnhancedStore } from '@reduxjs/toolkit'
import { configureStore, createAction, createSlice } from '@reduxjs/toolkit'

import type { PayloadAction } from '@reduxjs/toolkit'
import type {
AbortSignalWithReason,
ForkedTaskExecutor,
PayloadAction,
TaskResult,
} from '../types'
import { TaskAbortError, createListenerMiddleware } from '../index'
} from '@reduxjs/toolkit'
import {
TaskAbortError,
configureStore,
createAction,
createListenerMiddleware,
createSlice,
} from '@reduxjs/toolkit'
import {
listenerCancelled,
listenerCompleted,
taskCancelled,
taskCompleted,
} from '../exceptions'
import type { AbortSignalWithReason } from '../types'

function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms))
Expand Down
11 changes: 3 additions & 8 deletions packages/toolkit/src/listenerMiddleware/tests/useCases.test.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
import type { PayloadAction } from '@reduxjs/toolkit'
import {
TaskAbortError,
configureStore,
createAction,
createListenerMiddleware,
createSlice,
isAnyOf,
} from '@reduxjs/toolkit'

import type { PayloadAction } from '@reduxjs/toolkit'

import { createListenerMiddleware } from '../index'

import type { TypedAddListener } from '../index'
import { TaskAbortError } from '../exceptions'

interface CounterState {
value: number
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import {
isAnyOf,
isFulfilled,
isRejected,
isRejectedWithValue,
} from '../rtkImports'

import type {
EndpointDefinitions,
FullTagDescription,
} from '../../endpointDefinitions'
import { calculateProvidedBy } from '../../endpointDefinitions'
import { countObjectKeys } from '../../utils/countObjectKeys'
import type { CombinedState, QueryCacheKey } from '../apiState'
import { QueryStatus } from '../apiState'
import { calculateProvidedByThunk } from '../buildThunks'
import {
isAnyOf,
isFulfilled,
isRejected,
isRejectedWithValue,
} from '../rtkImports'
import type {
ApiMiddlewareInternalHandler,
InternalHandlerBuilder,
InternalMiddlewareState,
SubMiddlewareApi,
} from './types'
import { countObjectKeys } from '../../utils/countObjectKeys'

export const buildInvalidationByTagsHandler: InternalHandlerBuilder = ({
reducerPath,
Expand Down
1 change: 0 additions & 1 deletion packages/toolkit/src/query/core/buildMiddleware/polling.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { QueryStatus } from '../apiState'
import type {
ApiMiddlewareInternalHandler,
InternalHandlerBuilder,
InternalMiddlewareState,
QueryStateMeta,
SubMiddlewareApi,
TimeoutId,
Expand Down
5 changes: 1 addition & 4 deletions packages/toolkit/src/query/core/setupListeners.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import type {
ActionCreatorWithoutPayload,
ThunkDispatch, // Workaround for API-Extractor
} from '@reduxjs/toolkit'
import type { ThunkDispatch } from '@reduxjs/toolkit'
import { createAction } from './rtkImports'

export const onFocus = /* @__PURE__ */ createAction('__rtkq/focused')
Expand Down
1 change: 0 additions & 1 deletion packages/toolkit/src/query/tests/fetchBaseQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createSlice } from '@reduxjs/toolkit'
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query'
import { headersToObject } from 'headers-polyfill'
import { HttpResponse, delay, http } from 'msw'
// @ts-ignore
import nodeFetch from 'node-fetch'
import queryString from 'query-string'
import { vi } from 'vitest'
Expand Down
12 changes: 7 additions & 5 deletions packages/toolkit/src/tests/autoBatchEnhancer.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { configureStore } from '../configureStore'
import { createSlice } from '../createSlice'
import type { AutoBatchOptions } from '../autoBatchEnhancer'
import { autoBatchEnhancer, prepareAutoBatched } from '../autoBatchEnhancer'
import { delay } from '../utils'
import type { AutoBatchOptions } from '@reduxjs/toolkit'
import {
configureStore,
createSlice,
prepareAutoBatched,
} from '@reduxjs/toolkit'
import { debounce } from 'lodash'
import { delay } from '../utils'

interface CounterState {
value: number
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/tests/utils/CustomMatchers.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Assertion, AsymmetricMatchersContaining } from 'vitest'
import 'vitest'

interface CustomMatchers<R = unknown> {
toHaveConsoleOutput(expectedOutput: string): Promise<R>
Expand Down

0 comments on commit c84ac4b

Please sign in to comment.