15 lines
346 B
JavaScript
15 lines
346 B
JavaScript
var SetIntervalMixin = {
|
|
componentWillMount: function() {
|
|
this.intervals = [];
|
|
},
|
|
setInterval: function() {
|
|
//console.log('interval set');
|
|
this.intervals.push(setInterval.apply(null, arguments));
|
|
},
|
|
componentWillUnmount: function() {
|
|
//console.log('interval unmount');
|
|
this.intervals.forEach(clearInterval);
|
|
}
|
|
};
|
|
|