Skip to content

Commit 39dbccc

Browse files
committed
Convert QueryExtraOptions and MutationExtraOptions to type aliases
1 parent 383026c commit 39dbccc

File tree

2 files changed

+334
-325
lines changed

2 files changed

+334
-325
lines changed

packages/toolkit/src/query/core/buildMiddleware/cacheLifecycle.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit'
22
import type { BaseQueryFn, BaseQueryMeta } from '../../baseQueryTypes'
33
import type { BaseEndpointDefinition } from '../../endpointDefinitions'
44
import { DefinitionType } from '../../endpointDefinitions'
5+
import type { Id } from '../../tsHelpers'
56
import type { RootState } from '../apiState'
67
import type {
78
MutationResultSelectorResult,
@@ -29,10 +30,12 @@ export type QueryBaseLifecycleApi<
2930
* Gets the current value of this cache entry.
3031
*/
3132
getCacheEntry(): QueryResultSelectorResult<
32-
{ type: DefinitionType.query } & BaseEndpointDefinition<
33-
QueryArg,
34-
BaseQuery,
35-
ResultType
33+
Id<
34+
{ type: DefinitionType.query } & BaseEndpointDefinition<
35+
QueryArg,
36+
BaseQuery,
37+
ResultType
38+
>
3639
>
3740
>
3841
/**
@@ -52,10 +55,12 @@ export type MutationBaseLifecycleApi<
5255
* Gets the current value of this cache entry.
5356
*/
5457
getCacheEntry(): MutationResultSelectorResult<
55-
{ type: DefinitionType.mutation } & BaseEndpointDefinition<
56-
QueryArg,
57-
BaseQuery,
58-
ResultType
58+
Id<
59+
{ type: DefinitionType.mutation } & BaseEndpointDefinition<
60+
QueryArg,
61+
BaseQuery,
62+
ResultType
63+
>
5964
>
6065
>
6166
}

0 commit comments

Comments
 (0)