# stook

> A minimalist design state management library for React

Latest version **1.17.0** (published 2023-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install stook
pnpm add stook
yarn add stook
bun add stook
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.17.0 |
| Published | 2023-04-10 |
| First published | 2019-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 41.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | forsigner |
| Maintainers | forsigner |

## Links

- npm: https://www.npmjs.com/package/stook
- Homepage: https://github.com/forsigner/stook
- Issues: https://github.com/forsigner/stook/issues
- npm.io page: https://npm.io/package/stook

## Dependencies (2)

- [mitt](https://npm.io/package/mitt.md) ^3.0.0
- [immer](https://npm.io/package/immer.md) ^9.0.12

## Recent versions

- 1.17.0 (latest) — 2023-04-10
- 1.16.0 — 2023-03-30
- 1.15.0 — 2023-03-30
- 1.14.0 — 2023-03-29
- 1.13.0 — 2022-09-25
- 1.12.0 — 2022-08-29
- 1.11.0 — 2022-02-16
- 1.10.0 — 2021-10-21
- 1.9.0 — 2021-10-19
- 1.8.0 — 2021-10-18
- 1.7.0 — 2021-10-09
- 1.6.1 — 2021-09-27
- 1.5.1 — 2021-08-23
- 1.5.0 — 2021-08-18
- 1.4.0 — 2021-08-13
- … 21 more at https://npm.io/package/stook/versions

## README

# Stook

[![npm](https://img.shields.io/npm/v/stook.svg)](https://www.npmjs.com/package/stook) [![Coverage Status](https://coveralls.io/repos/github/forsigner/stook/badge.svg?branch=master)](https://coveralls.io/github/forsigner/stook?branch=master) [![Minzipped size](https://img.shields.io/bundlephobia/minzip/stook.svg)](https://bundlephobia.com/result?p=stook) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg)](https://github.com/prettier/prettier)

A minimalist design state management library for React.

## Documentation

The documentation site of stook is hosted at  [https://stook.vercel.app](https://stook.vercel.app).

## Quick start

**simplest**

```tsx
import React from 'react'
import { useStore } from 'stook'

function Counter() {
  const [count, setCount] = useStore('Counter', 0)
  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>Click me</button>
    </div>
  )
}
```

**share state**

```jsx
import React from 'react'
import { useStore } from 'stook'

function Counter() {
  const [count, setCount] = useStore('Counter', 0)
  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>Click me</button>
    </div>
  )
}

function Display() {
  const [count] = useStore('Counter')
  return <p>{count}</p>
}

function App() {
  return (
    <div>
      <Counter />
      <Display />
    </div>
  )
}
```

## License

[MIT License](https://github.com/forsigner/stook/blob/master/LICENSE)

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