flutter_built_redux_hooks 0.1.2 flutter_built_redux_hooks: ^0.1.2 copied to clipboard
Set of hooks that provide or connect to your redux store
Usage #
ReduxProvider
usage:
runApp(ReduxProvider(
store: new Store(
createReducer(),
State(),
StateActions(),
),
child: child,
));
useReduxActions
usage:
HookBuilder(
builder: (context) {
MyActions actions = useReduxActions<MyActions>();
return RaisedButton(
onPressed: () => actions.someAction(),
child: new Text('dispatch action'),
),
},
)
useReduxActions
usage:
HookBuilder(
builder: (context) {
SubState sub = useReduxState<State, SubState>((s) => s.sub);
return Text(sub.textProp);
},
)