# create-global-state-hook

> Creates a hook like useState but all instances will have a single shared storage

Latest version **0.0.2** (published 2021-08-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install create-global-state-hook
pnpm add create-global-state-hook
yarn add create-global-state-hook
bun add create-global-state-hook
```

## 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.0.2 |
| Published | 2021-08-22 |
| First published | 2021-08-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Stanislav Termosa |
| Maintainers | termosa |

## Links

- npm: https://www.npmjs.com/package/create-global-state-hook
- Repository: https://github.com/termosa/create-global-state-hook
- Homepage: https://github.com/termosa/create-global-state-hook#readme
- Issues: https://github.com/termosa/create-global-state-hook/issues
- npm.io page: https://npm.io/package/create-global-state-hook

## Recent versions

- 0.0.2 (latest) — 2021-08-22
- 0.0.1 — 2021-08-21

## README

# crete-global-state-hook

Creates a hook like useState but all instances will have a single shared storage

## Example

```js
import creteGlobalStateHook from 'crete-global-state-hook'

const useGlobalCounter = createGlobalStateHook(0)

export default function GlobalCounter() {
    const [count, setCount] = useGlobalCounter()
    return (
        <div>
            <input type="button" value="-" onClick={() => setCount(count - 1)} />
            {count}
            <input type="button" value="+" onClick={() => setCount(count + 1)} />
        </div>
    )
}
```

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