fschaefer/Timer.js

Unable to add multiple 'after's

Closed this issue · 0 comments

This works:

var timer = new Timer('100 milliseconds');
timer.every('1 seconds', function(){ console.log('1 sec'); });
timer.after('5 seconds', function(){ console.log('after 5 secs'); });

However, this results in an error (Uncaught TypeError: Cannot read property 'callback' of undefined ) at the first after.

var timer = new Timer('100 milliseconds');
timer.every('1 seconds', function(){ console.log('1 sec'); });
timer.after('5 seconds', function(){ console.log('after 5 secs'); });
timer.after('6 seconds', function(){ console.log('after 6 secs'); });