# use-global-storage

> [![NPM Version](https://img.shields.io/npm/v/use-global-storage.svg?style=flat-square)](https://www.npmjs.com/package/use-global-storage)

Latest version **0.1.0** (published 2019-10-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install use-global-storage
pnpm add use-global-storage
yarn add use-global-storage
bun add use-global-storage
```

## 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.1.0 |
| Published | 2019-10-30 |
| First published | 2019-04-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 134.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12 |
| Maintainers | embbnux |
| Keywords | react, hooks, storage, global storage, state management |

## Links

- npm: https://www.npmjs.com/package/use-global-storage
- Repository: https://github.com/embbnux/use-global-storage
- Homepage: https://github.com/embbnux/use-global-storage#readme
- Issues: https://github.com/embbnux/use-global-storage/issues
- npm.io page: https://npm.io/package/use-global-storage

## Dependencies (1)

- [rt-storage](https://npm.io/package/rt-storage.md) ^0.1.0

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2019-10-30
- 0.0.4 — 2019-05-17
- 0.0.3 — 2019-04-23
- 0.0.2 — 2019-04-22
- 0.0.1 — 2019-04-22

## README

# use-global-storage

[![NPM Version](https://img.shields.io/npm/v/use-global-storage.svg?style=flat-square)](https://www.npmjs.com/package/use-global-storage)

React Hook to connect storage and state. You can use this as a global state manager in React.

## Install

via npm:

```
npm install use-global-storage
```

via yarn:

```
yarn add use-global-storage
```

## Usage

```js
import useGlobalStorage from 'use-global-storage';

const useStorage = useGlobalStorage({
  storageOptions: { name: 'test-db' }
});

const Counter = () => {
  const [state, setState] = useStorage('counter');
  return (
    <div className="Counter">
      <p>
        Counter:
        {state || 0}
      </p>
      <button type="button" onClick={() => setState(state + 1)}>
        +1 to global
      </button>
    </div>
  );
};
```

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