Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thaddeusjiang/react-promise-data
Don't wrong again about "isLoading? 🔄 : isError ? ❌ : 👍"
https://github.com/thaddeusjiang/react-promise-data
promise reactjs
Last synced: 21 days ago
JSON representation
Don't wrong again about "isLoading? 🔄 : isError ? ❌ : 👍"
- Host: GitHub
- URL: https://github.com/thaddeusjiang/react-promise-data
- Owner: ThaddeusJiang
- License: mit
- Created: 2022-04-18T13:48:05.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-18T14:40:27.000Z (over 2 years ago)
- Last Synced: 2024-12-05T05:42:32.331Z (29 days ago)
- Topics: promise, reactjs
- Language: TypeScript
- Homepage: https://main--625d767992aa2c003a9d90ff.chromatic.com
- Size: 317 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Welcome to @thaddeusjiang/react-promise-data 👋
> Don't wrong again about "isLoading? 🔄 : isError ? ❌ : 👍"
## Features
- [x] isLoading? 🔄 : isError ? ❌ : 👍
## Install
```sh
yarn add @thaddeusjiang/react-promise-data
```## Usage
```js
export const DefaultLoading = () => {
return (
{({ data }) =>{data}}
);
};export const DefaultError = () => {
return (
{({ data }) =>{data}}
);
};export const DefaultData = () => {
return (
{({ data }) =>{data}}
);
};export const CustomLoading = () => {
return (
🔄 Custom Loading...}
>
{({ data }) =>{data}}
);
};export const CustomError = () => {
return (
💥 Custom Error: {error}}
>
{({ data }) =>{data}}
);
};
```## Development
### StorybookRun inside another terminal:
```bash
yarn storybook
```### Example
Then run the example inside another:
```bash
yarn linkcd example
yarn link "@thaddeusjiang/react-promise-data"
yarn # or yarn to install dependencies
yarn start #```
### Run tests
```sh
yarn test
```## Author
👤 **Thaddeus Jiang**
* Website: https://thaddeusjiang.com/
* Twitter: [@ThaddeusJiang](https://twitter.com/ThaddeusJiang)
* Github: [@ThaddeusJiang](https://github.com/ThaddeusJiang)## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/ThaddeusJiang/react-promise-data/issues). You can also take a look at the [contributing guide](https://github.com/ThaddeusJiang/react-promise-data/blob/main/CONTRIBUTING.md).## Show your support
Give a ⭐️ if this project helped you!
## 📝 License
Copyright © 2022 [Thaddeus Jiang](https://github.com/ThaddeusJiang).
This project is [MIT](https://github.com/ThaddeusJiang/react-promise-data/blob/main/LICENSE) licensed.***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_