# neat-state

> neat state is a super super lightweight react state management library

Latest version **0.0.2** (published 2023-03-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install neat-state
pnpm add neat-state
yarn add neat-state
bun add neat-state
```

## 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 | 2023-03-29 |
| First published | 2023-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Vitor Boccio |
| Maintainers | vitorboccio |
| Keywords | neat, state, management, react, typescript |

## Links

- npm: https://www.npmjs.com/package/neat-state
- Repository: https://github.com/vitorboccio/neat-state
- Homepage: https://github.com/vitorboccio/neat-state#readme
- Issues: https://github.com/vitorboccio/neat-state/issues
- npm.io page: https://npm.io/package/neat-state

## Dependencies (2)

- [react](https://npm.io/package/react.md) ^18.2.0
- [react-dom](https://npm.io/package/react-dom.md) ^18.2.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.0.2 (latest) — 2023-03-29
- 0.0.1 — 2023-03-29

## README

# Neat-state


# Usage

1. set a state to the global store
```
import { neat } from 'neat-state'

const myValueNeat = neat(100)
``` 

2. get a value from the global store
```
import { neat } from 'neat-state'

const getMyValueNeat = neat((get) => get(myValue))
```

3. get a value from promise
```
import { neat } from 'neat-state'

const promiseDataNeat = neat(() => fetch('url-data').then((res) => res.json()))
```

4. use store within components
```
import { useNeat } from 'neat-state'

const [myValue, setMyValue] = useNeat(myValueNeat)

<>{myValue}</>

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