twister-react/build-buffer/common/SetIntervalMixin.js
Julian Steinwachs 451baa38b9 conversation fix
2015-04-30 11:42:10 +02:00

15 lines
401 B
JavaScript

module.exports = SetIntervalMixin = {
componentWillMount: function() {
this.intervals = [];
},
setInterval: function() {
if (arguments[1]) {
this.intervals.push(setInterval.apply(null, arguments));
} else {
console.log("setInterval requested with malformed interval argument");
}
},
componentWillUnmount: function() {
this.intervals.map(clearInterval);
}
};