import { useEffect } from 'react'
import useReduxState, { useSetState } from 'use-redux-states'
const Component = () => {
useReduxState({
state: {
state1: 'a',
state2: 'b'
},
path: 'component_state'
})
const setState = useSetState('component_state')
useEffect(() => {
setState({ state2: 'c' }, (component_state, payload) => ({
...component_state,
...payload
}))
}, [])
}