An open API service indexing awesome lists of open source software.

https://github.com/forsigner/stook

A minimalist design state management library for React.
https://github.com/forsigner/stook

form graphql hooks react redux state-management

Last synced: about 1 year ago
JSON representation

A minimalist design state management library for React.

Awesome Lists containing this project

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 (


You clicked {count} times


setCount(count + 1)}>Click me

)
}
```

**share state**

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

function Counter() {
const [count, setCount] = useStore('Counter', 0)
return (


You clicked {count} times


setCount(count + 1)}>Click me

)
}

function Display() {
const [count] = useStore('Counter')
return

{count}


}

function App() {
return (





)
}
```

## License

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