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/api/created-api/cache-management-utils.mdx
+49-2Lines changed: 49 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ interface PatchCollection {
31
31
32
32
-**Parameters**
33
33
-`endpointName`: a string matching an existing endpoint name
34
-
-`args`: a cache key, used to determine which cached dataset needs to be updated
34
+
-`args`: an argument matching that used for a previous query call, used to determine which cached dataset needs to be updated
35
35
-`updateRecipe`: an Immer `produce` callback that can apply changes to the cached state
36
36
37
37
#### Description
@@ -44,7 +44,10 @@ The thunk returns an object containing `{patches: Patch[], inversePatches: Patch
44
44
45
45
This is typically used as the first step in implementing optimistic updates. The generated `inversePatches` can be used to revert the updates by calling `dispatch(patchQueryData(endpointName, args, inversePatches))`. Alternatively, the `undo` method can be called directly to achieve the same effect.
46
46
47
-
#### Example
47
+
Note that the first two arguments (`endpointName` and `args`) are used to determine which existing
48
+
cache entry to update. If no existing cache entry is found, the `updateRecipe` callback will not run.
0 commit comments