@bgfist/weact-redux
v2.0.0
Published
Weact bindings for Redux
Downloads
9
Readme
Weact-Redux
Weact bindings for Redux
install
npm i @bgfist/weact-redux
Provider
import {Provider} from "@bgfist/weact-redux";
import store from ...
App(Provider(store)({
onLoad(){},
...
}))
hook-style
import { useSelector, useActionCreator } from "@bgfist/weact-redux";
function Demo() {
const age = useSelector(state=> state.age);
const changeAgeAction = useActionCreator(changeAge);
const onTapSomething = () => changeAgeAction(10);
return {
age,
onTapSomething
}
}