@@ -9,10 +9,10 @@ import { connect } from 'react-redux';
99import { createStructuredSelector } from 'reselect' ;
1010
1111import Stopwatch from 'components/Stopwatch' ;
12- import { resetTimer , startTimer , stopTimer , addLap } from './actions' ;
12+ import { resetTimer , startTimer , pauseTimer } from './actions' ;
1313
1414
15- import { makeSelectIntervalsElapsed } from './selectors' ;
15+ import { makeSelectIsPaused , makeSelectIntervalsElapsed } from './selectors' ;
1616
1717class Timer extends React . PureComponent { // eslint-disable-line react/prefer-stateless-function
1818
@@ -22,8 +22,9 @@ class Timer extends React.PureComponent { // eslint-disable-line react/prefer-st
2222 < Stopwatch
2323 intervalsElapsed = { this . props . intervalsElapsed }
2424 startTimer = { this . props . startTimer }
25- stopTimer = { this . props . stopTimer }
25+ pauseTimer = { this . props . pauseTimer }
2626 resetTimer = { this . props . resetTimer }
27+ isPaused = { this . props . isPaused }
2728 />
2829 </ div >
2930 ) ;
@@ -34,21 +35,22 @@ class Timer extends React.PureComponent { // eslint-disable-line react/prefer-st
3435Timer . propTypes = {
3536 resetTimer : PropTypes . func . isRequired ,
3637 startTimer : PropTypes . func . isRequired ,
37- stopTimer : PropTypes . func . isRequired ,
38+ pauseTimer : PropTypes . func . isRequired ,
3839 intervalsElapsed : PropTypes . number ,
40+ isPaused : PropTypes . bool ,
3941} ;
4042
4143function mapDispatchToProps ( dispatch ) {
4244 return {
4345 startTimer : ( ) => dispatch ( startTimer ( dispatch ) ) ,
44- stopTimer : ( ) => dispatch ( stopTimer ( ) ) ,
46+ pauseTimer : ( ) => dispatch ( pauseTimer ( ) ) ,
4547 resetTimer : ( ) => dispatch ( resetTimer ( ) ) ,
46- lapTimer : ( ) => dispatch ( addLap ( ) ) ,
4748 } ;
4849}
4950
5051const mapStateToProps = createStructuredSelector ( {
5152 intervalsElapsed : makeSelectIntervalsElapsed ( ) ,
53+ isPaused : makeSelectIsPaused ( ) ,
5254} ) ;
5355
5456
0 commit comments