timer-promise

0.0.2 • Public • Published

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);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.2
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.2
    3
  • 0.0.1
    1

Package Sidebar

Install

npm i timer-promise

Weekly Downloads

4

Version

0.0.2

License

none

Last publish

Collaborators

  • iwongu