Skip to content

Commit 31a2720

Browse files
committed
Deduplicate RTKQ imports
1 parent 5bb06ed commit 31a2720

File tree

6 files changed

+14
-6
lines changed

6 files changed

+14
-6
lines changed

packages/toolkit/src/query/react/ApiProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { Context } from 'react'
33
import { useContext, useEffect } from './reactImports'
44
import * as React from 'react'
55
import type { ReactReduxContextValue } from 'react-redux'
6-
import { Provider, ReactReduxContext } from 'react-redux'
7-
import { setupListeners } from '@reduxjs/toolkit/query'
6+
import { Provider, ReactReduxContext } from './reactReduxImports'
7+
import { setupListeners } from './rtkqImports'
88
import type { Api } from '@reduxjs/toolkit/query'
99

1010
/**

packages/toolkit/src/query/react/buildHooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import type {
3939
TSHelpersNoInfer,
4040
TSHelpersOverride,
4141
} from '@reduxjs/toolkit/query'
42-
import { QueryStatus, skipToken } from '@reduxjs/toolkit/query'
42+
import { QueryStatus, skipToken } from './rtkqImports'
4343
import type { DependencyList } from 'react'
4444
import {
4545
useCallback,

packages/toolkit/src/query/react/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// does not have to import this into each source file it rewrites.
33
import { formatProdErrorMessage } from '@reduxjs/toolkit'
44

5-
import { buildCreateApi, coreModule } from '@reduxjs/toolkit/query'
5+
import { buildCreateApi, coreModule } from './rtkqImports'
66
import { reactHooksModule, reactHooksModuleName } from './module'
77

88
export * from '@reduxjs/toolkit/query'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { shallowEqual } from 'react-redux'
1+
export { shallowEqual, Provider, ReactReduxContext } from 'react-redux'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export {
2+
buildCreateApi,
3+
coreModule,
4+
copyWithStructuralSharing,
5+
setupListeners,
6+
QueryStatus,
7+
skipToken,
8+
} from '@reduxjs/toolkit/query'

packages/toolkit/src/query/react/useSerializedStableValue.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useRef, useMemo } from './reactImports'
2-
import { copyWithStructuralSharing } from '@reduxjs/toolkit/query'
2+
import { copyWithStructuralSharing } from './rtkqImports'
33

44
export function useStableQueryArgs<T>(queryArgs: T) {
55
const cache = useRef(queryArgs)

0 commit comments

Comments
 (0)