# use-cofx

> Use cofx with react hooks

Latest version **1.0.1** (published 2019-03-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-cofx
pnpm add use-cofx
yarn add use-cofx
bun add use-cofx
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2019-03-23 |
| First published | 2019-03-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Author | Eric Bower |
| Maintainers | neurosnap |

## Links

- npm: https://www.npmjs.com/package/use-cofx
- Repository: https://github.com/neurosnap/use-cofx
- npm.io page: https://npm.io/package/use-cofx

## Recent versions

- 1.0.1 (latest) — 2019-03-23

## README

# use-cofx [![Build Status](https://travis-ci.org/neurosnap/use-cofx.svg?branch=master)](https://travis-ci.org/neurosnap/use-cofx)

Use `cofx` with react hooks

```js
import useCofx from 'use-cofx';

function* fetchMovies() {
  const resp = yield call(fetch, '/movies');
  const json = yield call([resp, 'json']);
  return json;
}

const App = () => {
  const { loading, error, value } = useCofx(fetchMovies);

  if (loading) {
    return <div>Loading ...</div>
  }

  if (error) {
    return <div>Error: {value}</div>
  }

  return <div>{value}</div>
};
```

See [cofx](https://github.com/neurosnap/cofx) for more information on what `cofx` can do

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