# react-rest-store

> Apollo inspired library to connect redux, local-storage, and rest domains seamlessly.

Latest version **1.0.14** (published 2020-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-rest-store
pnpm add react-rest-store
yarn add react-rest-store
bun add react-rest-store
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2020-12-09 |
| First published | 2020-11-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 181.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | vssrcj |
| Maintainers | vssrcj |

## Links

- npm: https://www.npmjs.com/package/react-rest-store
- Repository: https://github.com/bluebirddev/react-rest-store
- Homepage: https://github.com/bluebirddev/react-rest-store#readme
- Issues: https://github.com/bluebirddev/react-rest-store/issues
- npm.io page: https://npm.io/package/react-rest-store

## Recent versions

- 1.0.14 (latest) — 2020-12-09
- 1.0.13 — 2020-12-06
- 1.0.12 — 2020-12-06
- 1.0.11 — 2020-12-05
- 1.0.10 — 2020-12-05
- 1.0.9 — 2020-12-01
- 1.0.8 — 2020-12-01
- 1.0.7 — 2020-12-01
- 1.0.6 — 2020-11-26
- 1.0.5 — 2020-11-25
- 1.0.4 — 2020-11-25
- 1.0.3 — 2020-11-21
- 1.0.2 — 2020-11-21
- 1.0.1 — 2020-11-21
- 1.0.0 — 2020-11-21

## README

# react-rest-store

> Apollo inspired library to connect redux, local-storage, and rest domains seamlessly.

[![NPM](https://img.shields.io/npm/v/react-rest-store.svg)](https://www.npmjs.com/package/react-rest-store) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## What is this?

It is a library to attempt to make life easier by reducing boilerplate introduced with Redux + API connections.

### Features
* Tracking Rest executions (does not execute same command twice).
* Exclusive use of hooks for clean code.
* Persisting data in a redux store.
* Persisting data over refreshes (localstorage).
* Has intervals.
* Has manually fetching.
* Exposes native libraries.

# Todo!

Minimize the laundry list of dependencies.

## Install

```bash
npm install --save react-rest-store
```

## Simplest Usage

Example [here](https://bluebirddev.github.io/react-rest-store)

```tsx
import React from 'react';

import {createRrs } from 'react-rest-store';

const { Provider, domain } = createRrs({
  domain: {
    baseURL: 'https://jsonplaceholder.typicode.com',
  },
});

const Todos = () => {
  const { data: todos, loading } = domain.useGet('/todos');

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

  return (
    <table>
      <thead>
        <tr>
          <th>Title</th>
          <th>Completed</th>
        </tr>
      </thead>
      <tbody>
        {todos.map((todo: any) => (
          <tr key={todo.id}>
            <td>{todo.title}</td>
            <td>{todo.completed && 'X'}</td>
          </tr>
        ))}
      </tbody>
    </table>
  );
};

const App = () => (
  <Provider>
    <Todos />
  </Provider>
);

export default App;
```

## License

MIT © [vssrcj](https://github.com/vssrcj)

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