# react-use-effect-async

> Async useEffect hook

Latest version **1.0.2** (published 2021-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-use-effect-async
pnpm add react-use-effect-async
yarn add react-use-effect-async
bun add react-use-effect-async
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-11-07 |
| First published | 2021-11-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Abraham Hernandez |
| Maintainers | abranhe |

## Links

- npm: https://www.npmjs.com/package/react-use-effect-async
- Repository: https://github.com/abranhe/react-use-effect-async
- Homepage: https://github.com/abranhe/react-use-effect-async#readme
- Issues: https://github.com/abranhe/react-use-effect-async/issues
- npm.io page: https://npm.io/package/react-use-effect-async

## Dependencies (1)

- [react](https://npm.io/package/react.md) ^17.0.2

## Recent versions

- 1.0.2 (latest) — 2021-11-07
- 1.0.1 — 2021-11-07
- 1.0.0 — 2021-11-07
- 0.0.5 — 2021-11-07
- 0.0.4 — 2021-11-07
- 0.0.3 — 2021-11-07
- 0.0.2 — 2021-11-07
- 0.0.1 — 2021-11-07

## README

# react-use-effect-async 

[![npm version](https://img.shields.io/npm/v/react-use-effect-async.svg)](https://www.npmjs.com/package/react-use-effect-async)

> Async useEffect hook. Just because I was lazy to create this hook on every project.

## Install

```bash
$ npm install react-use-effect-async
```

## Usage

```js
import React from 'react';
import useEffectAsync from 'react-use-effect-async';

export function Demo() {
  const [data, setData] = React.useState(null);

  useEffectAsync(async () => {
    const response = await fetch('https://api.github.com/users/abranhe');
    const data = await response.json();

    setData(data);
  }, [data]);

  return <div>{!data ? <p>Loading...</p> : <p>{data.name}</p>}</div>;
}
```

---
_Source: https://npm.io/package/react-use-effect-async · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
