Skip to content

Commit 01c30b9

Browse files
committed
rtk query behaviour blurb
1 parent 5d3e605 commit 01c30b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docs/migrations/1.x-to-2.x.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,13 @@ The standalone version of `getDefaultMiddleware` has been deprecated since v1.6.
265265

266266
We have also removed the `getType` export, which was used to extract a type string from action creators made with `createAction`. Instead, use the static property `actionCreator.type`.
267267

268-
#### RTK Query tag invalidation behaviour
268+
#### RTK Query behaviour changes
269+
270+
We've had a number of reports where RTK Query had issues around usage of `dispatch(endpoint.initiate(arg, {subscription: false}))`. There were also reports that multiple triggered lazy queries were resolving the promises at the wrong time. Both of these had the same underlying issue, which was that RTKQ wasn't tracking cache entries in these cases (intentionally). We've reworked the logic to always track cache entries (and remove them as needed), which should resolve those behavior issues.
271+
272+
We also have had issues raised about trying to run multiple mutations in a row and how tag invalidation behaves. 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.
273+
274+
In RTK 1.9, we reworked RTK Query's internals to keep most of the subscription status inside the RTKQ middleware. The values are still synced to the Redux store state, but this is primarily for display by the Redux DevTools "RTK Query" panel. Related to the cache entry changes above, we've optimized how often those values get synced to the Redux state for perf.
269275

270276
#### `reactHooksModule` custom hook configuration
271277

0 commit comments

Comments
 (0)