1.17.0 • Published 1 year ago

stook v1.17.0

Weekly downloads
73
License
MIT
Repository
-
Last release
1 year ago

Stook

npm Coverage Status Minzipped size code style: prettier

A minimalist design state management library for React.

Documentation

The documentation site of stook is hosted at https://stook.vercel.app.

Quick start

simplest

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

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

1.15.0

1 year ago

1.14.0

1 year ago

1.17.0

1 year ago

1.16.0

1 year ago

1.13.0

2 years ago

1.12.0

2 years ago

1.11.0

2 years ago

1.9.0

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.10.0

3 years ago

1.6.1

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.5.0

3 years ago

0.3.0

4 years ago

0.4.0

4 years ago

0.2.5

4 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.2

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.1

4 years ago