twister-react/build-buffer/common/SetIntervalMixin.js
2015-04-29 11:19:10 +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);
}
};