mirror of
https://github.com/twisterarmy/twister-react.git
synced 2025-01-13 08:27:57 +00:00
15 lines
401 B
JavaScript
Executable File
15 lines
401 B
JavaScript
Executable File
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);
|
|
}
|
|
}; |