31
31
</a >
32
32
</p >
33
33
34
- React component and hook for declarative promise resolution and data fetching. Leverages the Render Props pattern and
35
- Hooks for ultimate flexibility as well as the new Context API for ease of use. Makes it easy to handle loading and
36
- error states, without assumptions about the shape of your data or the type of request .
34
+ React component and hook for declarative promise resolution and data fetching. Makes it easy to handle every
35
+ state of the asynchronous process, without assumptions about the shape of your data or the type of request.
36
+ Use it with ` fetch ` , Axios or other data fetching libraries, even GraphQL .
37
37
38
38
- Zero dependencies
39
39
- Works with promises, async/await and the Fetch API
40
40
- Choose between Render Props, Context-based helper components or the ` useAsync ` and ` useFetch ` hooks
41
+ - Debug and develop every part of the loading sequence with the [ DevTools] ( #devtools )
41
42
- Provides convenient ` isLoading ` , ` startedAt ` , ` finishedAt ` , et al metadata
42
43
- Provides ` cancel ` and ` reload ` actions
43
44
- Automatic re-run using ` watch ` or ` watchFn ` prop
@@ -60,6 +61,7 @@ error states, without assumptions about the shape of your data or the type of re
60
61
- [ Rationale] ( #rationale )
61
62
- [ Concurrent React and Suspense] ( #concurrent-react-and-suspense )
62
63
- [ Installation] ( #installation )
64
+ - [ DevTools] ( #devtools )
63
65
- [ Upgrading] ( #upgrading )
64
66
- [ Usage] ( #usage )
65
67
- [ As a hook] ( #as-a-hook )
@@ -120,6 +122,33 @@ yarn add react-async
120
122
> This package requires ` react ` as a peer dependency. Please make sure to install that as well.
121
123
> If you want to use the ` useAsync ` hook, you'll need ` [email protected] ` or later.
122
124
125
+ ### DevTools
126
+
127
+ React Async comes with a separate DevTools package which helps you Debug and develop your asynchronous application states.
128
+
129
+ ```
130
+ npm install --save react-async-devtools
131
+ ```
132
+
133
+ Or with Yarn:
134
+
135
+ ```
136
+ yarn add react-async-devtools
137
+ ```
138
+
139
+ Then simply import it and render the` <DevTools/> ` component at the root of your app:
140
+
141
+ ``` jsx
142
+ import DevTools from " react-async-devtools"
143
+
144
+ export const Root = () => (
145
+ <>
146
+ < DevTools / >
147
+ < App / >
148
+ < / >
149
+ )
150
+ ```
151
+
123
152
### Upgrading
124
153
125
154
#### Upgrade to v8
0 commit comments