Skip to content

Commit 126b299

Browse files
authored
Add DevTools section
1 parent 5bed28d commit 126b299

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,14 @@
3131
</a>
3232
</p>
3333

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.
3737

3838
- Zero dependencies
3939
- Works with promises, async/await and the Fetch API
4040
- 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)
4142
- Provides convenient `isLoading`, `startedAt`, `finishedAt`, et al metadata
4243
- Provides `cancel` and `reload` actions
4344
- 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
6061
- [Rationale](#rationale)
6162
- [Concurrent React and Suspense](#concurrent-react-and-suspense)
6263
- [Installation](#installation)
64+
- [DevTools](#devtools)
6365
- [Upgrading](#upgrading)
6466
- [Usage](#usage)
6567
- [As a hook](#as-a-hook)
@@ -120,6 +122,33 @@ yarn add react-async
120122
> This package requires `react` as a peer dependency. Please make sure to install that as well.
121123
> If you want to use the `useAsync` hook, you'll need `[email protected]` or later.
122124
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+
123152
### Upgrading
124153

125154
#### Upgrade to v8

0 commit comments

Comments
 (0)