0.1.3 • Published 8 years ago

promisified-timer v0.1.3

Weekly downloads
36
License
-
Repository
github
Last release
8 years ago

timer-promise

This is an adaptation of Wongoo Lee's timer-promise library. Thanks, Wongoo!

Stuff I added ontop of the original:

  • UMD modules for frontend use.
  • Typescript definitions.
  • Use ES6 Promises (or a polyfil) instead of bringing it in via node require().

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

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago