1.0.0 • Published 4 years ago
vue-redux-composable v1.0.0
vue-redux-composable
Mainly inspired by react-redux
npm package (https://github.com/reduxjs/react-redux)
Exposed function
provideStore(store)
- Need to be call in
setup()
(https://composition-api.vuejs.org/api.html#setup) - Provide your store to an HOC (as
App.vue
) and to this lib.
- Need to be call in
useStore()
- Need to be call in
setup()
(https://composition-api.vuejs.org/api.html#setup) - Provide the redux
store
.
- Need to be call in
useSelector(selector)
- Return a
ref()
where thevalue
property is reactively change if the state is updated. (https://composition-api.vuejs.org/api.html#ref)
- Return a
useDispatch()
- Return
dispatch
- Return
Simple use case
How to provide your
store
to the lib :How to use it in
setup()
:
1.0.0
4 years ago