Skip to content

dominictarr/idle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages