@@ -39,11 +39,7 @@ import type {
39
39
TSHelpersNoInfer ,
40
40
TSHelpersOverride ,
41
41
} from '@reduxjs/toolkit/query'
42
- import {
43
- defaultSerializeQueryArgs ,
44
- QueryStatus ,
45
- skipToken ,
46
- } from '@reduxjs/toolkit/query'
42
+ import { QueryStatus , skipToken } from '@reduxjs/toolkit/query'
47
43
import type { DependencyList } from 'react'
48
44
import {
49
45
useCallback ,
@@ -1644,17 +1640,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
1644
1640
subscriptionSelectorsRef . current =
1645
1641
returnedValue as unknown as SubscriptionSelectors
1646
1642
}
1647
- const stableArg = useStableQueryArgs (
1648
- skip ? skipToken : arg ,
1649
- // Even if the user provided a per-endpoint `serializeQueryArgs` with
1650
- // a consistent return value, _here_ we want to use the default behavior
1651
- // so we can tell if _anything_ actually changed. Otherwise, we can end up
1652
- // with a case where the query args did change but the serialization doesn't,
1653
- // and then we never try to initiate a refetch.
1654
- defaultSerializeQueryArgs ,
1655
- context . endpointDefinitions [ endpointName ] ,
1656
- endpointName ,
1657
- )
1643
+ const stableArg = useStableQueryArgs ( skip ? skipToken : arg )
1658
1644
const stableSubscriptionOptions = useShallowStableValue ( {
1659
1645
refetchOnReconnect,
1660
1646
refetchOnFocus,
@@ -1764,12 +1750,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
1764
1750
QueryDefinition < any , any , any , any , any > ,
1765
1751
Definitions
1766
1752
>
1767
- const stableArg = useStableQueryArgs (
1768
- skip ? skipToken : arg ,
1769
- serializeQueryArgs ,
1770
- context . endpointDefinitions [ endpointName ] ,
1771
- endpointName ,
1772
- )
1753
+ const stableArg = useStableQueryArgs ( skip ? skipToken : arg )
1773
1754
1774
1755
type ApiRootState = Parameters < ReturnType < typeof select > > [ 0 ]
1775
1756
@@ -2053,17 +2034,7 @@ export function buildHooks<Definitions extends EndpointDefinitions>({
2053
2034
2054
2035
usePromiseRefUnsubscribeOnUnmount ( promiseRef )
2055
2036
2056
- const stableArg = useStableQueryArgs (
2057
- options . skip ? skipToken : arg ,
2058
- // Even if the user provided a per-endpoint `serializeQueryArgs` with
2059
- // a consistent return value, _here_ we want to use the default behavior
2060
- // so we can tell if _anything_ actually changed. Otherwise, we can end up
2061
- // with a case where the query args did change but the serialization doesn't,
2062
- // and then we never try to initiate a refetch.
2063
- defaultSerializeQueryArgs ,
2064
- context . endpointDefinitions [ endpointName ] ,
2065
- endpointName ,
2066
- )
2037
+ const stableArg = useStableQueryArgs ( options . skip ? skipToken : arg )
2067
2038
2068
2039
const refetch = useCallback (
2069
2040
( ) => refetchOrErrorIfUnmounted ( promiseRef ) ,
0 commit comments