timeouts

v0.0.1
thin wrapper on setTimeout to keep track of and clear timeouts
timeout setTimeout timeout manager

timeouts

trying to make it easier to clean up timeouts

Install

npm install timeouts

Usage

var Timeouts = require('timeouts')

var timeouts = Timeouts()

var tid1 = timeouts.timeout(function() {
  console.log('yo')
}, 1000)

var tid2 = timeouts.timeout(function() {
  console.log('not yo')
}, 1000)

timeouts.clear(tid1) // clear one timeout
timeouts.clearAll() // clear all timeouts created by this instance
npm i timeouts

Metadata

  • MIT
  • Whatever
  • Mark Vayngrib
  • released 5/24/2015

Downloads

Maintainers