Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jarweb/wolverine-state
a lightweight react state management lib build with contex、hook and immer
https://github.com/jarweb/wolverine-state
hook immer react state-management
Last synced: 3 days ago
JSON representation
a lightweight react state management lib build with contex、hook and immer
- Host: GitHub
- URL: https://github.com/jarweb/wolverine-state
- Owner: Jarweb
- Created: 2020-04-14T06:34:16.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:27:37.000Z (about 2 years ago)
- Last Synced: 2025-01-14T15:02:38.216Z (13 days ago)
- Topics: hook, immer, react, state-management
- Language: TypeScript
- Homepage:
- Size: 2.77 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 18
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### intro
a lightweight react state management lib based on immer 、 react hook and context
### quick start
```
yarn add @jarzzzi/wolverine-state
```### example
```javascript
const initialState: StoreData = {
count: 0,
show: false
}const store = createStore(initialState)
function Demo () {
const { count } = useConnect>((state) => {
return { count: state.count }
})const inc = () => {
store.produce((state) => {
state.count++
})
}const dec = () => {
store.produce((state) => {
state.count--
})
}return (
{count}
inc
dec
)
}function App () {
return (
)
}
```