idle

0.0.0 • Public • Published

idle

Trigger a listener that fires only when a certain event has not occured within a time window.

Example

var idle = require ('idle')
 
idle(emitter, 'okay',  10*1000, function onIdle () {
  //this function will be called when 'okay'
  //has not been emitted within 10 seconds.
  console.log('NOT OKAY')
 
  //you can still clear the timeout in the normal way
  emitter.removeListener('okay', onIdle)
})
 

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.0
    139
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.0
    139

Package Sidebar

Install

npm i idle

Weekly Downloads

139

Version

0.0.0

License

MIT

Last publish

Collaborators

  • nopersonsmodules