react-idle-timer
Advanced tools
@@ -68,2 +68,7 @@ 'use strict'; | ||
}, { | ||
key: 'componentDidMount', | ||
value: function componentDidMount() { | ||
if (this.props.startOnLoad) this.reset(); | ||
} | ||
}, { | ||
key: 'componentWillUnmount', | ||
@@ -297,3 +302,4 @@ value: function componentWillUnmount() { | ||
element: _react.PropTypes.oneOfType([_react.PropTypes.object, _react.PropTypes.string]), // Element ref to watch activty on | ||
format: _react.PropTypes.string | ||
format: _react.PropTypes.string, | ||
startOnLoad: _react.PropTypes.bool | ||
}; | ||
@@ -305,4 +311,5 @@ IdleTimer.defaultProps = { | ||
activeAction: function activeAction() {}, | ||
element: document | ||
element: document, | ||
startOnLoad: true | ||
}; | ||
exports.default = IdleTimer; |
@@ -115,2 +115,3 @@ 'use strict'; | ||
timeout: this.state.timeout, | ||
startOnLoad: true, | ||
format: 'MM-DD-YYYY HH:MM:ss.SSS' }, | ||
@@ -117,0 +118,0 @@ _react3.default.createElement( |
{ | ||
"name": "react-idle-timer", | ||
"version": "1.2.11", | ||
"version": "1.2.12", | ||
"description": "Activity detection for React.js", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -54,2 +54,3 @@ # React Idle Timer | ||
- **format** {*String*} - moment.js format string applied to `lastActiveTime` | ||
- **startOnLoad** {*Boolean*} - Start the timer on component load. Defaults to `true`. Set to false to wait for user action before starting timer. | ||
@@ -56,0 +57,0 @@ ## Methods |
26134
1.43%482
1.69%67
1.52%