You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rtk-query/internal/buildMiddleware/invalidationByTags.mdx
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
## Overview
5
5
`InvalidationByTagsHandler` is a handler instantiated during the (BuildMiddleware) step of the build. The handler acts as a (Middleware) and executes each step in response to matching of internal asyncThunk actions.
6
6
7
-
i.e. the primary trigger for a "invalidation sequence" are these two cases:
7
+
The matchers used for a "invalidation sequence" are these two cases:
8
8
```ts no-transpile
9
9
const isThunkActionWithTags =isAnyOf(
10
10
isFulfilled(mutationThunk),
@@ -25,7 +25,7 @@ The handler has 3 core conditionals that trigger a sequence:
25
25
26
26
1. Mutation trigger
27
27
2. Query trigger
28
-
3.manual invalidation via `api.util.invalidateTags`Sequence
28
+
3.Manual invalidation via `api.util.invalidateTags`trigger
1. invalidateTags function is called with a list of tags generated from the action metadata
63
63
2. in the case of a [queryThunk] resolution an empty set of tags is always provided
64
-
2.the tags calculated are added to the list of pending tags to invalidate (see [delayed](### Delayed) )
64
+
2.The tags calculated are added to the list of pending tags to invalidate (see [delayed](Delayed) )
65
65
3. (optional: 'Delayed') the invalidateTags function is ended if the `apiSlice.invalidationBehaviour` is set to "delayed" and there are any pending thunks/queries running in that `apiSlice`
66
-
4.pending tags are reset to an empty list, if there are no tags the function ends here
67
-
5.selects all `{ endpointName, originalArgs, queryCacheKey }` combinations that would be invalidated by a specific set of tags.
68
-
6.iterates through queryCacheKeys selected and performs one of two actions if the query exists*
66
+
4.Pending tags are reset to an empty list, if there are no tags the function ends here
67
+
5.Selects all `{ endpointName, originalArgs, queryCacheKey }` combinations that would be invalidated by a specific set of tags.
68
+
6.Iterates through queryCacheKeys selected and performs one of two actions if the query exists*
69
69
1. removes cached query result - via the `removeQueryResult` action - if no subscription is active
70
70
2. if the query is "uninitialized" it initiates a `refetchQuery` action
0 commit comments