Expand file tree Collapse file tree 9 files changed +39
-43
lines changed Original file line number Diff line number Diff line change 1
- import { createDraftSafeSelectorCreator } from '../../createDraftSafeSelector'
2
- import type { EntityAdapter , EntityState } from '../index'
3
- import { createEntityAdapter } from '../index'
4
- import type { EntitySelectors } from '../models'
1
+ import type {
2
+ EntityAdapter ,
3
+ EntitySelectors ,
4
+ EntityState ,
5
+ Selector ,
6
+ } from '@reduxjs/toolkit'
7
+ import {
8
+ createDraftSafeSelectorCreator ,
9
+ createEntityAdapter ,
10
+ createSelector ,
11
+ } from '@reduxjs/toolkit'
5
12
import type { BookModel } from './fixtures/book'
6
13
import { AClockworkOrange , AnimalFarm , TheGreatGatsby } from './fixtures/book'
7
- import type { Selector } from 'reselect'
8
- import { createSelector , weakMapMemoize } from 'reselect'
9
- import { vi } from 'vitest'
10
14
11
15
describe ( 'Entity State Selectors' , ( ) => {
12
16
describe ( 'Composed Selectors' , ( ) => {
Original file line number Diff line number Diff line change 1
1
import type { Middleware } from 'redux'
2
2
import type { IgnorePaths } from './serializableStateInvariantMiddleware'
3
- import type { AnyObject } from './tsHelpers'
4
3
import { getTimeMeasureUtils } from './utils'
5
4
6
5
type EntryProcessor = ( key : string , value : any ) => any
Original file line number Diff line number Diff line change 1
- import type { EnhancedStore } from '@reduxjs/toolkit'
2
- import { configureStore , createAction , createSlice } from '@reduxjs/toolkit'
3
-
4
- import type { PayloadAction } from '@reduxjs/toolkit'
5
1
import type {
6
- AbortSignalWithReason ,
7
2
ForkedTaskExecutor ,
3
+ PayloadAction ,
8
4
TaskResult ,
9
- } from '../types'
10
- import { TaskAbortError , createListenerMiddleware } from '../index'
5
+ } from '@reduxjs/toolkit'
6
+ import {
7
+ TaskAbortError ,
8
+ configureStore ,
9
+ createAction ,
10
+ createListenerMiddleware ,
11
+ createSlice ,
12
+ } from '@reduxjs/toolkit'
11
13
import {
12
14
listenerCancelled ,
13
15
listenerCompleted ,
14
16
taskCancelled ,
15
17
taskCompleted ,
16
18
} from '../exceptions'
19
+ import type { AbortSignalWithReason } from '../types'
17
20
18
21
function delay ( ms : number ) {
19
22
return new Promise ( ( resolve ) => setTimeout ( resolve , ms ) )
Original file line number Diff line number Diff line change
1
+ import type { PayloadAction } from '@reduxjs/toolkit'
1
2
import {
3
+ TaskAbortError ,
2
4
configureStore ,
3
5
createAction ,
6
+ createListenerMiddleware ,
4
7
createSlice ,
5
- isAnyOf ,
6
8
} from '@reduxjs/toolkit'
7
9
8
- import type { PayloadAction } from '@reduxjs/toolkit'
9
-
10
- import { createListenerMiddleware } from '../index'
11
-
12
- import type { TypedAddListener } from '../index'
13
- import { TaskAbortError } from '../exceptions'
14
-
15
10
interface CounterState {
16
11
value : number
17
12
}
Original file line number Diff line number Diff line change 1
- import {
2
- isAnyOf ,
3
- isFulfilled ,
4
- isRejected ,
5
- isRejectedWithValue ,
6
- } from '../rtkImports'
7
-
8
1
import type {
9
2
EndpointDefinitions ,
10
3
FullTagDescription ,
11
4
} from '../../endpointDefinitions'
12
5
import { calculateProvidedBy } from '../../endpointDefinitions'
6
+ import { countObjectKeys } from '../../utils/countObjectKeys'
13
7
import type { CombinedState , QueryCacheKey } from '../apiState'
14
8
import { QueryStatus } from '../apiState'
15
9
import { calculateProvidedByThunk } from '../buildThunks'
10
+ import {
11
+ isAnyOf ,
12
+ isFulfilled ,
13
+ isRejected ,
14
+ isRejectedWithValue ,
15
+ } from '../rtkImports'
16
16
import type {
17
17
ApiMiddlewareInternalHandler ,
18
18
InternalHandlerBuilder ,
19
- InternalMiddlewareState ,
20
19
SubMiddlewareApi ,
21
20
} from './types'
22
- import { countObjectKeys } from '../../utils/countObjectKeys'
23
21
24
22
export const buildInvalidationByTagsHandler : InternalHandlerBuilder = ( {
25
23
reducerPath,
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { QueryStatus } from '../apiState'
7
7
import type {
8
8
ApiMiddlewareInternalHandler ,
9
9
InternalHandlerBuilder ,
10
- InternalMiddlewareState ,
11
10
QueryStateMeta ,
12
11
SubMiddlewareApi ,
13
12
TimeoutId ,
Original file line number Diff line number Diff line change 1
- import type {
2
- ActionCreatorWithoutPayload ,
3
- ThunkDispatch , // Workaround for API-Extractor
4
- } from '@reduxjs/toolkit'
1
+ import type { ThunkDispatch } from '@reduxjs/toolkit'
5
2
import { createAction } from './rtkImports'
6
3
7
4
export const onFocus = /* @__PURE__ */ createAction ( '__rtkq/focused' )
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import { createSlice } from '@reduxjs/toolkit'
2
2
import { createApi , fetchBaseQuery } from '@reduxjs/toolkit/query'
3
3
import { headersToObject } from 'headers-polyfill'
4
4
import { HttpResponse , delay , http } from 'msw'
5
- // @ts -ignore
6
5
import nodeFetch from 'node-fetch'
7
6
import queryString from 'query-string'
8
7
import { vi } from 'vitest'
Original file line number Diff line number Diff line change 1
- import { configureStore } from '../configureStore'
2
- import { createSlice } from '../createSlice'
3
- import type { AutoBatchOptions } from '../autoBatchEnhancer'
4
- import { autoBatchEnhancer , prepareAutoBatched } from '../autoBatchEnhancer'
5
- import { delay } from '../utils'
1
+ import type { AutoBatchOptions } from '@reduxjs/toolkit'
2
+ import {
3
+ configureStore ,
4
+ createSlice ,
5
+ prepareAutoBatched ,
6
+ } from '@reduxjs/toolkit'
6
7
import { debounce } from 'lodash'
8
+ import { delay } from '../utils'
7
9
8
10
interface CounterState {
9
11
value : number
0 commit comments