1.1.0 • Published 9 years ago

onstop v1.1.0

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

onstop

Detect when a recurring event has stopped happening, given a time interval.

Usage

var onstop = require('onstop');

var someEventEmitter = getEventEmitterSomehow();

var fn = onstop(3000, function() { // if the event stops for 3 seconds this function gets called.
  console.log('The event stopped happening.');
});

someEventEmitter.on('myevent', fn);

if the event stops happening, then starts, and then stops again, the function will be called twice.

License

MIT