stable-timeout

0.0.4 • Public • Published

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

Package Sidebar

Install

npm i stable-timeout

Weekly Downloads

9

Version

0.0.4

License

MIT

Last publish

Collaborators

  • fractal
  • nulltask
  • yocontra