Skip to content

Checks if a user is idle for a configurable amount of time and fires a callback

Notifications You must be signed in to change notification settings

micnews/idle-timer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

idle-timer

Checks if a user is idle for a configurable amount of time and fires a callback

Build Status

Usage

var timer = idleTimer({
  // function to fire after idle
  callback: callbackFn,
  // function to fire when active
  activeCallback: activeCallbackFn,
  // Amount of time in milliseconds before becoming idle. default 60000
  idleTime: 5000
})
function callbackFn () {
  console.log("You're idle!");
}

// when no longer needed, destroy() will remove
// all of the event listeners and clear the timeouts
timer.destroy();

About

Checks if a user is idle for a configurable amount of time and fires a callback

Resources

Stars

Watchers

Forks

Packages

No packages published