0.0.4 • Published 9 years ago

stable-timeout v0.0.4

Weekly downloads
6
License
MIT
Repository
github
Last release
9 years ago

stable-timeout

Stable setTimeout.

Installation

$ npm install stable-timeout

Example

var StableTimeout = require('stable-timeout');
var timeout = new StableTimeout();
var clearButton = document.querySelector('.button-clear');

timeout.set(function() {
  console.log('fired after 10s');
}, 10000);

clearButton.addEventListener('click', function(e) {
  // cancel timeout
  timeout.clear();
}, false);

License

MIT