Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.
/ react-async-effect Public archive

A component to help manage work outside render cycle

License

Notifications You must be signed in to change notification settings

edygar/react-async-effect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Async Effect

downloads version MIT License

All Contributors

Supports React and Preact size gzip size module formats: umd, cjs, and es

Watch on GitHub Star on GitHub Tweet

The problem

You want to render the result of an asynchronously effect (action) that happens outside the scope of the component. In order to do so, you have to take care and be aware of the communication format (is it a promise, an observable or a pubsub?) and not only, you should manage race condition against the component unmounting. More, you also need to represent the current state of that action on screen, being either a pending state, an error or the proper result. In case of error, you want to allow user to retry.

This solution

This component helps on the creation of components that provides control over an async effect, so it deals only with its task. Also, it normalizes the way of work on imperative effects modeled as components.

Table of Contents

Props

TBD

Contributors

Thanks goes to these people (emoji key):


Edygar de Lima Oliveira

💻 📖 🚇

Miguel Silva

💻 🤔

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

About

A component to help manage work outside render cycle

Resources

License

Stars

Watchers

Forks

Packages

No packages published