twister-react/js/SetIntervalMixin.js
2015-04-21 19:38:17 +02:00

11 lines
279 B
JavaScript

module.exports = SetIntervalMixin = {
componentWillMount: function() {
this.intervals = [];
},
setInterval: function() {
this.intervals.push(setInterval.apply(null, arguments));
},
componentWillUnmount: function() {
this.intervals.map(clearInterval);
}
};