# custom-hook-fetch-api

> custom hook for api call's

Latest version **1.2.0** (published 2022-03-07) · ISC license · 0 weekly downloads

## Install

```sh
npm install custom-hook-fetch-api
pnpm add custom-hook-fetch-api
yarn add custom-hook-fetch-api
bun add custom-hook-fetch-api
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.0 |
| Published | 2022-03-07 |
| First published | 2022-03-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dimchykus |
| Maintainers | dimchukys |

## Links

- npm: https://www.npmjs.com/package/custom-hook-fetch-api
- Repository: https://github.com/Dimchykus/custom-hook-fetch-api
- Issues: https://github.com/Dimchykus/custom-hook-fetch-api/issues
- npm.io page: https://npm.io/package/custom-hook-fetch-api

## Dependencies (2)

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

## Recent versions

- 1.2.0 (latest) — 2022-03-07
- 1.0.0 — 2022-03-05

## README

# custom-hook-fetch-api

## Installation

```
npm i custom-hook-fetch-api
```
### OR
```
yarn add custom-hook-fetch-api
```

## Quick Start

## Basic Usage
```
import { useEffect } from "react";
import Request from "custom-hook-fetch-api";

const App = () => {
  const data = Request("https://api.coindesk.com/v1/bpi/currentprice.json", {method: "GET"});

  useEffect(() => {
    data.request();
  }, []);

  useEffect(() => {
    console.log(data.data);
  }, [data.data]);

  if (data.loading) return <div>Loading!!!</div>;
  if (data.error) return <div>Error!!!</div>;

  return <div className="App">Done</div>;
};
```

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