Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ Returns the wrapped component instance. Only available if you pass `{ withRef: t
export default connect()(TodoApp)
```

##### Inject all action creators (`addTodo`, `completeTodo`, ...) without subscribing to the store

```js
import * as actionCreators from './actionCreators'

export default connect(null, actionCreators)(TodoApp)
```

##### Inject `dispatch` and every field in the global state

>Don’t do this! It kills any performance optimizations because `TodoApp` will rerender after every action.
Expand All @@ -126,7 +134,7 @@ function mapStateToProps(state) {
export default connect(mapStateToProps)(TodoApp)
```

##### Inject `todos` and all action creators (`addTodo`, `completeTodo`, ...)
##### Inject `todos` and all action creators

```js
import * as actionCreators from './actionCreators'
Expand Down