Skip to content

Commit

Permalink
feat: update TS types to support invalidateTags and selectInvalidated…
Browse files Browse the repository at this point in the history
…By changes
  • Loading branch information
FaberVitale committed Oct 19, 2024
1 parent 0b68542 commit 9ff5656
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/core/buildMiddleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function buildMiddleware<

const actions = {
invalidateTags: createAction<
Array<TagTypes | FullTagDescription<TagTypes>>
Array<TagTypes | FullTagDescription<TagTypes> | null | undefined>
>(`${reducerPath}/invalidateTags`),
}

Expand Down
4 changes: 2 additions & 2 deletions packages/toolkit/src/query/core/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export interface ApiModules<
* ```
*/
invalidateTags: ActionCreatorWithPayload<
Array<TagDescription<TagTypes>>,
Array<TagDescription<TagTypes> | null | undefined>,
string
>

Expand All @@ -361,7 +361,7 @@ export interface ApiModules<
*/
selectInvalidatedBy: (
state: RootState<Definitions, string, ReducerPath>,
tags: ReadonlyArray<TagDescription<TagTypes>>,
tags: ReadonlyArray<TagDescription<TagTypes> | null | undefined>,
) => Array<{
endpointName: string
originalArgs: any
Expand Down
2 changes: 1 addition & 1 deletion packages/toolkit/src/query/endpointDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export type ResultDescription<
ErrorType,
MetaType,
> =
| ReadonlyArray<TagDescription<TagTypes>>
| ReadonlyArray<TagDescription<TagTypes> | undefined | null>
| GetResultDescriptionFn<TagTypes, ResultType, QueryArg, ErrorType, MetaType>

type QueryTypes<
Expand Down

0 comments on commit 9ff5656

Please sign in to comment.