Skip to content

Commit 3d738fa

Browse files
author
sectore
committed
CounterApp should be dump without any knowledge about Redux(dispatch(), bindActionCreators())
1 parent 74705d8 commit 3d738fa

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Counter/app/containers/counterApp.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,19 @@ class CounterApp extends Component {
1515
}
1616

1717
render() {
18-
const { state, dispatch } = this.props;
19-
18+
const { state, actions } = this.props;
2019
return (
2120
<Counter
2221
counter={state.count}
23-
{...bindActionCreators(counterActions, dispatch)} />
22+
{...actions} />
2423
);
2524
}
2625
}
2726

2827
export default connect(state => ({
29-
state: state.counter
30-
}))(CounterApp);
28+
state: state.counter
29+
}),
30+
(dispatch) => ({
31+
actions: bindActionCreators(counterActions, dispatch)
32+
})
33+
)(CounterApp);

0 commit comments

Comments
 (0)