Skip to content

iwongu/timer-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

timer-promise

Promise version of setTimeout and clearTimeout

You can start and stop timer like this.

var timer = require('timer-promise');

timer.start('foo', 5000).
  then(function() {
  }, function(cancelled) {
  });
...
timer.stop('foo');

instead of

var timeoutId = setTimeout(function() {
}, 5000);
...
clearTimeout(timeoutId);

About

Promise version of setTimeout and clearTimeout

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published