MCPcopy Index your code
hub / github.com/async-library/react-async

github.com/async-library/react-async @v10.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v10.0.1 ↗ · + Follow
156 symbols 353 edges 57 files 1 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

React Async

Handle promises with ease.

latest version montly downloads minzipped size license

circleci status travis status code coverage code quality DeepScan grade

live examples Chromatic All Contributors

React component and hook for declarative promise resolution and data fetching. Makes it easy to handle every state of the asynchronous process, without assumptions about the shape of your data or the type of request. Use it with fetch, Axios or other data fetching libraries, even GraphQL.

  • Zero dependencies
  • Works with promises, async/await and the Fetch API
  • Now with experimental Suspense support
  • Choose between Render Props, Context-based helper components or the useAsync and useFetch hooks
  • Debug and develop every part of the loading sequence with the React Async DevTools
  • Provides convenient isPending, startedAt, finishedAt, et al metadata
  • Provides cancel and reload actions
  • Automatic re-run using watch or watchFn prop
  • Accepts onResolve, onReject and onCancel callbacks
  • Supports abortable fetch by providing an AbortController
  • Supports optimistic updates using setData
  • Supports server-side rendering through initialValue
  • Written in TypeScript, ships with type definitions
  • Works well in React Native too!

Upgrading to v9

Version 9 comes with a minor breaking change. See Upgrading for details.

Documentation

Getting started

API

Guide

Contributing

Contributors

Thanks goes to these wonderful people (emoji key):

Gert Hengeveld 💻 👀 💬 Khartir 💻 📦 Lenz Weber 💻 📦 🤔 Avinash 👀 📖 Fred K. Schott 🔧 Cedric van Putten 💻 Tom Shane 👀
Philip Peterson 💻 Sibelius Seraphini 👀 Jim Cummins 👀 Mihkel Sokk 👀 Jiří Brabec 💻 Andrii U 💡 Matthisk Heimensen 💻
Danny Hurlburt 🤔 📖 Noel Yoo ⚠️ 💻 🤔 Adam Ratcliffe 💻 Kent C. Dodds 💻 walter-ind 📖 Jacob Lee 💻 Youngrok Kim 💻
Munir Ahmed Elsangedy 🤔 AlixWang 📖 Sal Olivares 💻 🐛 Neale Upstone 💻 Martin Barksten

Extension points exported contracts — how you extend this code

FetchRun (Interface)
(no doc) [1 implementers]
packages/react-async/src/useAsync.tsx
DevToolsProps (Interface)
(no doc)
packages/react-async-devtools/src/index.d.ts
InitialProps (Interface)
(no doc)
packages/react-async/src/Async.tsx
PendingProps (Interface)
(no doc)
packages/react-async/src/Async.tsx
FulfilledProps (Interface)
(no doc)
packages/react-async/src/Async.tsx
RejectedProps (Interface)
(no doc)
packages/react-async/src/Async.tsx

Core symbols most depended-on inside this repo

sleep
called by 15
packages/react-async/src/specs.js
useAsync
called by 14
packages/react-async/src/useAsync.tsx
resolveIn
called by 12
packages/react-async/src/specs.js
createInstance
called by 9
packages/react-async/src/Async.tsx
run
called by 7
packages/react-async-devtools/src/index.js
load
called by 6
packages/react-async/src/Async.tsx
getInitialStatus
called by 5
packages/react-async/src/status.ts
getStatusProps
called by 5
packages/react-async/src/status.ts

Shape

Function 107
Method 20
Class 15
Interface 12
Enum 2

Languages

TypeScript100%

Modules by API surface

packages/react-async/src/Async.tsx29 symbols
packages/react-async/src/specs.js18 symbols
packages/react-async/src/useAsync.tsx13 symbols
packages/react-async/src/useAsync.spec.js7 symbols
packages/react-async/src/reducer.ts7 symbols
packages/react-async/src/helpers.tsx6 symbols
examples/movie-app/src/api.js6 symbols
examples/movie-app/src/App.js6 symbols
examples/with-typescript/src/App.tsx5 symbols
stories/index.stories.js4 symbols
packages/react-async/src/types.ts4 symbols
packages/react-async/src/status.ts4 symbols

For agents

$ claude mcp add react-async \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact