5.0.3 • Published 8 years ago
react-timers v5.0.3
react-timers
A react setInterval
/setTimeout
mixin for mere mortals.
Any intervals that are set are automatically cleared based on the component life cycle.
WARNING: If you are performing an async action, you should still check if the component is mounted.
Example
var Timers = require('react-timers')
module.exports = React.createClass({
mixins: [Timers],
componentDidMount: function () {
var self = this
this.setTimeout(function () {
self.setState({ lastUpdated: new Date() })
}, 1000)
this.setInterval(function () {
self.setState({ lastUpdated: new Date() })
}, 1000)
},
render: function () {
// ... etc
}
})
LICENSE MIT
5.0.3
8 years ago
5.0.2
8 years ago
5.0.1
8 years ago
5.0.0
10 years ago
4.0.6
10 years ago
4.0.5
10 years ago
3.4.3
10 years ago
4.0.4
10 years ago
4.0.3
10 years ago
3.4.2
10 years ago
4.0.2
10 years ago
3.4.1
10 years ago
4.0.1
10 years ago
4.0.0
10 years ago
3.4.0
10 years ago
3.3.1
10 years ago
3.3.0
10 years ago
3.2.0
10 years ago
3.1.2
10 years ago
3.1.0
10 years ago
3.0.0
10 years ago
2.0.0
10 years ago