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

/stable-timeout/

    Package Sidebar

    Install

    npm i stable-timeout

    Weekly Downloads

    4

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • fractal
    • nulltask
    • yocontra