Comparing version 0.2.3 to 0.2.4
{ | ||
"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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
64
36576
18
Updatedimmer@^5.3.2