flutter_built_redux_hooks 0.1.0 flutter_built_redux_hooks: ^0.1.0 copied to clipboard
Adds flutter hooks for built redux
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);
},
)