@@ -2,20 +2,14 @@ import React, { PropTypes } from 'react';
2
2
import { connect } from 'react-redux' ;
3
3
import classnames from 'classnames' ;
4
4
5
- import { increment , doubleAsync } from '../../redux/modules/counter' ;
5
+ import { increment , doubleAsync , tripleSaga } from '../../redux/modules/counter' ;
6
6
import DuckImage from './Duck.jpg' ;
7
7
import classes from './HomeView.css' ;
8
8
9
9
// We avoid using the `@connect` decorator on the class definition so
10
10
// that we can export the undecorated component for testing.
11
11
// See: http://rackt.github.io/redux/docs/recipes/WritingTests.html
12
12
export 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
-
19
13
render ( ) {
20
14
return (
21
15
< div className = 'container text-center' >
@@ -35,19 +29,29 @@ export class HomeView extends React.Component {
35
29
< button className = 'btn btn-default' onClick = { this . props . increment } >
36
30
Increment
37
31
</ button >
38
- { ' ' }
39
32
< button className = 'btn btn-default' onClick = { this . props . doubleAsync } >
40
33
Double (Async)
41
34
</ button >
35
+ < button className = 'btn btn-default' onClick = { this . props . tripleSaga } >
36
+ Triple (Saga)
37
+ </ button >
42
38
</ div >
43
39
) ;
44
40
}
45
41
}
46
42
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
+
47
50
const mapStateToProps = ( state ) => ( {
48
51
counter : state . get ( 'counter' )
49
52
} ) ;
50
53
export default connect ( ( mapStateToProps ) , {
51
54
increment : ( ) => increment ( 1 ) ,
52
- doubleAsync
55
+ doubleAsync,
56
+ tripleSaga
53
57
} ) ( HomeView ) ;
0 commit comments