Skip to content

Commit 89f96f1

Browse files
committed
feat: update TS types to support invalidateTags and selectInvalidatedBy changes
1 parent 3018d96 commit 89f96f1

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function buildMiddleware<
4848

4949
const actions = {
5050
invalidateTags: createAction<
51-
Array<TagTypes | FullTagDescription<TagTypes>>
51+
Array<TagTypes | FullTagDescription<TagTypes> | null | undefined>
5252
>(`${reducerPath}/invalidateTags`),
5353
}
5454

packages/toolkit/src/query/core/module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ export interface ApiModules<
350350
* ```
351351
*/
352352
invalidateTags: ActionCreatorWithPayload<
353-
Array<TagDescription<TagTypes>>,
353+
Array<TagDescription<TagTypes> | null | undefined>,
354354
string
355355
>
356356

@@ -361,7 +361,7 @@ export interface ApiModules<
361361
*/
362362
selectInvalidatedBy: (
363363
state: RootState<Definitions, string, ReducerPath>,
364-
tags: ReadonlyArray<TagDescription<TagTypes>>,
364+
tags: ReadonlyArray<TagDescription<TagTypes> | null | undefined>,
365365
) => Array<{
366366
endpointName: string
367367
originalArgs: any

packages/toolkit/src/query/endpointDefinitions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export type ResultDescription<
242242
ErrorType,
243243
MetaType,
244244
> =
245-
| ReadonlyArray<TagDescription<TagTypes>>
245+
| ReadonlyArray<TagDescription<TagTypes> | undefined | null>
246246
| GetResultDescriptionFn<TagTypes, ResultType, QueryArg, ErrorType, MetaType>
247247

248248
type QueryTypes<

0 commit comments

Comments
 (0)