# api-grabber

> for fetching (grabbing) data from an Api in react app

Latest version **0.2.5** (published 2023-04-05) · 0 weekly downloads

## Install

```sh
npm install api-grabber
pnpm add api-grabber
yarn add api-grabber
bun add api-grabber
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2023-04-05 |
| First published | 2023-03-31 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | pholoshoseloane, nthangeniph |
| Keywords | fetch react data, fetcher, Api Grabber |

## Links

- npm: https://www.npmjs.com/package/api-grabber
- npm.io page: https://npm.io/package/api-grabber

## Dependencies (13)

- [axios](https://npm.io/package/axios.md) ^1.3.4
- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.0
- [typescript](https://npm.io/package/typescript.md) ^4.9.5
- [web-vitals](https://npm.io/package/web-vitals.md) ^2.1.4
- [@types/jest](https://npm.io/package/@types/jest.md) ^27.5.2
- [@types/node](https://npm.io/package/@types/node.md) ^16.18.23
- [@types/react](https://npm.io/package/@types/react.md) ^18.0.31
- [react-scripts](https://npm.io/package/react-scripts.md) 5.0.1
- [@types/react-dom](https://npm.io/package/@types/react-dom.md) ^18.0.11
- [@testing-library/react](https://npm.io/package/@testing-library/react.md) ^13.4.0
- [@testing-library/jest-dom](https://npm.io/package/@testing-library/jest-dom.md) ^5.16.5
- [@testing-library/user-event](https://npm.io/package/@testing-library/user-event.md) ^13.5.0

## Recent versions

- 0.2.5 (latest) — 2023-04-05
- 0.2.3 — 2023-04-05
- 0.2.2 — 2023-04-05
- 0.2.1 — 2023-04-05
- 0.2.0 — 2023-04-02
- 0.1.9 — 2023-03-31
- 0.1.8 — 2023-03-31
- 0.1.7 — 2023-03-31
- 0.1.6 — 2023-03-31
- 0.1.5 — 2023-03-31
- 0.1.3 — 2023-03-31
- 0.1.2 — 2023-03-31
- 0.1.1 — 2023-03-31
- 0.1.0 — 2023-03-31

## README

# Getting Started with Api-Grabber

for fetching (grabbing) data from an Api in react app

## Installation
npm i api-grabber

## Usage

```javascript
import { GrabberRequest } from "api-grabber";
import { IRequest } from "api-grabber/dist/components";
import { useState } from "react";
import { Button } from "react-bootstrap";

export const MyComponent = () => {
  const onGetData = () => {};
  const onError = () => {};

  const onLoading = () => {};

  const [request, setRequest] = useState<IRequest>({
    onGetData,
    onError,
    isRequest: true,
    onLoading,
    path: "http://localhost:3000/user",
    method :'GET'
  });

  const getPosts = ()=>{
    setRequest({
        ...request,
          isRequest: true,
        path: "http://localhost:3000/posts",
  
    })
  }

  return (
    <div>
        <Button onClick={getPosts}></Button>
      <GrabberRequest {...request} />
    </div>
  );
};

end
```

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