Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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

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 (




)
}
```