Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/async-library/react-async

🍾 Flexible promise-based React data loader
https://github.com/async-library/react-async

Last synced: about 2 months ago
JSON representation

🍾 Flexible promise-based React data loader

Lists

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!

[abortable fetch]: https://developers.google.com/web/updates/2017/09/abortable-fetch

> ## Upgrading to v9
>
> Version 9 comes with a minor breaking change.
> See [Upgrading](https://docs.react-async.com/getting-started/upgrading) for details.

# Documentation

- [Introduction](https://docs.react-async.com/)

## Getting started

- [Installation](https://docs.react-async.com/getting-started/installation)
- [Upgrading](https://docs.react-async.com/getting-started/upgrading)
- [Usage](https://docs.react-async.com/getting-started/usage)
- [DevTools](https://docs.react-async.com/getting-started/devtools)

## API

- [Interfaces](https://docs.react-async.com/api/interfaces)
- [Configuration options](https://docs.react-async.com/api/options)
- [State properties](https://docs.react-async.com/api/state)
- [Helper components](https://docs.react-async.com/api/helpers)

## Guide

- [Async components](https://docs.react-async.com/guide/async-components)
- [Separating view and logic](https://docs.react-async.com/guide/separating-view-logic)
- [Async actions](https://docs.react-async.com/guide/async-actions)
- [Optimistic updates](https://docs.react-async.com/guide/optimistic-updates)
- [Server-side rendering](https://docs.react-async.com/guide/server-side-rendering)

## Contributing

- [Introduction](https://docs.react-async.com/contributing/introduction)
- [Setting up](https://docs.react-async.com/contributing/setting-up)
- [Development](https://docs.react-async.com/contributing/development)
- [Testing](https://docs.react-async.com/contributing/testing)
- [Releasing](https://docs.react-async.com/contributing/releasing)

# Contributors

Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/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

📖

This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

## Similar projects

- [@slorber/react-async-hook](https://github.com/slorber/react-async-hook)
- [@dai-shi/react-hooks-async](https://github.com/dai-shi/react-hooks-async)
- [@cristovao-trevisan/async-resource](https://github.com/cristovao-trevisan/async-resource)
- [@ilyalesik/react-fetch-hook](https://github.com/ilyalesik/react-fetch-hook)
- [@marcin-piela/react-fetching-library](https://github.com/marcin-piela/react-fetching-library)