Skip to content

Commit 28fba73

Browse files
committed
Merge branch 'master' of https://github.com/reduxjs/redux-toolkit into configs
2 parents d0d6084 + c91db2b commit 28fba73

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const handler: ApiMiddlewareInternalHandler = (action, mwApi) => {
6464
1. invalidateTags function is called with a list of tags generated from the action metadata
6565
2. in the case of a [queryThunk] resolution an empty set of tags is always provided
6666
2. The tags calculated are added to the list of pending tags to invalidate (see [delayed](#Delayed))
67-
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`
67+
3. (optional: 'Delayed') the invalidateTags function is ended if the `apiSlice.invalidationBehavior` is set to "delayed" and there are any pending thunks/queries running in that `apiSlice`
6868
4. Pending tags are reset to an empty list, if there are no tags the function ends here
6969
5. Selects all `{ endpointName, originalArgs, queryCacheKey }` combinations that would be invalidated by a specific set of tags.
7070
6. Iterates through queryCacheKeys selected and performs one of two actions if the query exists\*
@@ -102,7 +102,7 @@ Step 6 is performed within a `context.batch()` call.
102102
103103
RTKQ now has internal logic to delay tag invalidation briefly, to allow multiple invalidations to get handled together. This is controlled by a new `invalidationBehavior: 'immediate' | 'delayed'` flag on `createApi`. The new default behavior is `'delayed'`. Set it to `'immediate'` to revert to the behavior in RTK 1.9.
104104
105-
The `'delayed'` behaviour enables a check inside `invalidationByTags` that will cause any invalidation that is triggered while a query/mutation is still pending to batch the invalidation until no query/mutation is running.
105+
The `'delayed'` behavior enables a check inside `invalidationByTags` that will cause any invalidation that is triggered while a query/mutation is still pending to batch the invalidation until no query/mutation is running.
106106
107107
```ts no-transpile
108108
function invalidateTags(

packages/toolkit/src/query/createApi.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export type CreateApiOptions<
153153
*/
154154
refetchOnReconnect?: boolean
155155
/**
156-
* Defaults to `'immediately'`. This setting allows you to control when tags are invalidated after a mutation.
156+
* Defaults to `'delayed'`. This setting allows you to control when tags are invalidated after a mutation.
157157
*
158158
* - `'immediately'`: Queries are invalidated instantly after the mutation finished, even if they are running.
159159
* If the query provides tags that were invalidated while it ran, it won't be re-fetched.

0 commit comments

Comments
 (0)