Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stook

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stook - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

15

package.json
{
"name": "stook",
"version": "0.2.3",
"version": "0.2.4",
"license": "MIT",

@@ -36,4 +36,4 @@ "author": "forsigner",

"@testing-library/react-hooks": "^3.2.1",
"@types/jest": "^24.0.23",
"@types/react": "^16.9.13",
"@types/jest": "^24.9.0",
"@types/react": "^16.9.17",
"@types/react-dom": "^16.9.4",

@@ -43,12 +43,11 @@ "react": "^16.12.0",

"react-test-renderer": "^16.12.0",
"tsdx": "^0.11.0",
"tsdx": "^0.12.3",
"tslib": "^1.10.0",
"typescript": "^3.7.2"
"typescript": "^3.7.4"
},
"dependencies": {
"immer": "^5.0.0",
"immer": "^5.3.2",
"mitt": "^1.2.0",
"react-fast-compare": "^2.0.4"
},
"gitHead": "9e338b617b461bb9ba4d590fe6b3017ef53f02f5"
}
}

@@ -5,10 +5,60 @@ # Stook

Manage {store} in {hooks}.
A minimalist design state management library for React.
## Documentation
The documentation site of stook is hosted at [The documentation site of stook is hosted at [https://stook.now.sh](https://stook.now.sh/).
The documentation site of stook is hosted at [https://stook-cn.now.sh](https://stook-cn.now.sh).
## 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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc