@@ -2,20 +2,14 @@ import React, { PropTypes } from 'react';
22import { connect } from 'react-redux' ;
33import classnames from 'classnames' ;
44
5- import { increment , doubleAsync } from '../../redux/modules/counter' ;
5+ import { increment , doubleAsync , tripleSaga } from '../../redux/modules/counter' ;
66import DuckImage from './Duck.jpg' ;
77import classes from './HomeView.css' ;
88
99// We avoid using the `@connect` decorator on the class definition so
1010// that we can export the undecorated component for testing.
1111// See: http://rackt.github.io/redux/docs/recipes/WritingTests.html
1212export class HomeView extends React . Component {
13- static propTypes = {
14- counter : PropTypes . number . isRequired ,
15- doubleAsync : PropTypes . func . isRequired ,
16- increment : PropTypes . func . isRequired
17- } ;
18-
1913 render ( ) {
2014 return (
2115 < div className = 'container text-center' >
@@ -35,19 +29,29 @@ export class HomeView extends React.Component {
3529 < button className = 'btn btn-default' onClick = { this . props . increment } >
3630 Increment
3731 </ button >
38- { ' ' }
3932 < button className = 'btn btn-default' onClick = { this . props . doubleAsync } >
4033 Double (Async)
4134 </ button >
35+ < button className = 'btn btn-default' onClick = { this . props . tripleSaga } >
36+ Triple (Saga)
37+ </ button >
4238 </ div >
4339 ) ;
4440 }
4541}
4642
43+ HomeView . propTypes = {
44+ counter : PropTypes . number . isRequired ,
45+ doubleAsync : PropTypes . func . isRequired ,
46+ increment : PropTypes . func . isRequired ,
47+ tripleSaga : PropTypes . func . isRequired
48+ } ;
49+
4750const mapStateToProps = ( state ) => ( {
4851 counter : state . get ( 'counter' )
4952} ) ;
5053export default connect ( ( mapStateToProps ) , {
5154 increment : ( ) => increment ( 1 ) ,
52- doubleAsync
55+ doubleAsync,
56+ tripleSaga
5357} ) ( HomeView ) ;
0 commit comments