Commit 2c05077
committed
Add example to API docs for no-subscribe actions
In a recent project, I needed a container component that had access
to a few actions, but it didn't need to subscribe to the store. The
component was just a button that performed an action; it didn't care
about what the state of the app was.
The docs for `connect` don't have an example for how to omit the
`mapStateToProps` argument, while still providing a value for
`mapDispatchToProps`.
I'm not entirely sure if this is the best way to accomplish that goal,
so please do let me know if there's a better/simpler way! I tried simply
passing a single `mapDispatchToProps` argument, but it was interpreted as
the `mapStateToProps` param.1 parent 93cdfae commit 2c05077
1 file changed
+9
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
109 | 117 | | |
110 | 118 | | |
111 | 119 | | |
| |||
126 | 134 | | |
127 | 135 | | |
128 | 136 | | |
129 | | - | |
| 137 | + | |
130 | 138 | | |
131 | 139 | | |
132 | 140 | | |
| |||
0 commit comments