react-redux-cache 0.13.0-rc.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ Examples of states, generated by cache reducer from `/example` project:
|
|
|
119
119
|
- [Advanced](https://github.com/gentlee/react-redux-cache#advanced)
|
|
120
120
|
- [Error handling](https://github.com/gentlee/react-redux-cache#error-handling)
|
|
121
121
|
- [Invalidation](https://github.com/gentlee/react-redux-cache#invalidation)
|
|
122
|
-
- [Extended fetch policy](https://github.com/gentlee/react-redux-cache#extended-
|
|
122
|
+
- [Extended & custom fetch policy](https://github.com/gentlee/react-redux-cache#extended--custom-fetch-policy)
|
|
123
123
|
- [Infinite scroll pagination](https://github.com/gentlee/react-redux-cache#infinite-scroll-pagination)
|
|
124
124
|
- [redux-persist](https://github.com/gentlee/react-redux-cache#redux-persist)
|
|
125
125
|
- [FAQ](https://github.com/gentlee/react-redux-cache#faq)
|
|
@@ -274,7 +274,7 @@ export const UserScreen = () => {
|
|
|
274
274
|
Queries and mutations are wrapped in try/catch, so any error will lead to cancelling of any updates to the state except `loading: false` and the caught error. If you still want to make some state updates, or just want to use thrown errors only for unexpected cases, consider returning expected errors as a part of the result:
|
|
275
275
|
|
|
276
276
|
```typescript
|
|
277
|
-
export const updateBank = (bank) => {
|
|
277
|
+
export const updateBank = (async (bank) => {
|
|
278
278
|
const {httpError, response} = ...
|
|
279
279
|
return {
|
|
280
280
|
result: {
|
|
@@ -284,7 +284,7 @@ export const updateBank = (bank) => {
|
|
|
284
284
|
bank: response?.bank
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
|
-
} satisfies Mutation<Partial<Bank>>
|
|
287
|
+
}) satisfies Mutation<Partial<Bank>>
|
|
288
288
|
```
|
|
289
289
|
|
|
290
290
|
If global error handling is needed for errors, not handled by query / mutation `onError` callback, global `onError` can be used:
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "react-redux-cache",
|
|
3
3
|
"author": "Alexander Danilov",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.13.0
|
|
5
|
+
"version": "0.13.0",
|
|
6
6
|
"description": "Powerful data fetching and caching library that supports normalization, built on top of redux",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"types": "dist/index.d.ts",
|