Skip to content

Commit b0e489c

Browse files
committed
Passover of invalidationByTags.mdx
1 parent 7178061 commit b0e489c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/rtk-query/internal/buildMiddleware/invalidationByTags.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Overview
55
`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.
66

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:
88
```ts no-transpile
99
const isThunkActionWithTags = isAnyOf(
1010
isFulfilled(mutationThunk),
@@ -25,7 +25,7 @@ The handler has 3 core conditionals that trigger a sequence:
2525

2626
1. Mutation trigger
2727
2. Query trigger
28-
3. manual invalidation via `api.util.invalidateTags` Sequence
28+
3. Manual invalidation via `api.util.invalidateTags` trigger
2929
```ts no-transpile
3030
const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {
3131
if (isThunkActionWithTags(action)) {
@@ -61,11 +61,11 @@ const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {
6161
1. `invalidateTags()` initiates:
6262
1. invalidateTags function is called with a list of tags generated from the action metadata
6363
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) )
6565
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*
6969
1. removes cached query result - via the `removeQueryResult` action - if no subscription is active
7070
2. if the query is "uninitialized" it initiates a `refetchQuery` action
7171
```js no-transpile

0 commit comments

Comments
 (0)