Timer management to clear large batches of timers.
$ component install component/timers
In the following example the last two timers will not fire.
var Timers = require('timers');
var timers = new Timers;
timers.timeout(function(){
console.log('one');
}, 1000);
timers.timeout(function(){
console.log('two');
}, 2000);
timers.timeout(function(){
console.log('three');
}, 3000);
setTimeout(function(){
timers.clear();
}, 1500);
Initialize a new timer set with optional ids
.
Add timeout fn
.
Add interval fn
.
Clear all timers.
MIT