Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

idle-tracker

0.0.6 • Public • Published

Idle Tracker

idle tracker
npm gzip size downloads circleci Greenkeeper badge

Javascript library to track browser idle status. (callback when user is idle).

Demo

Installation

via yarn

$ yarn add idle-tracker

or via npm

$ npm install idle-tracker

Usage

import IdleTracker from 'idle-tracker';
 
const idleTracker = new IdleTracker(options);
 
idleTracker.start(); // start tracker
 
idleTracker.end(); // stop tracker and release memory

Constructor options

Options Name Type Default Description
timeout (ms) number 30000 timeout to count as idle
onIdleCallback Function noop Function to be called when idle status change, payload will be { idle: true/false }
throttle number 500 throttle rate of callback

Install

npm i idle-tracker

DownloadsWeekly Downloads

497

Version

0.0.6

License

MIT

Unpacked Size

214 kB

Total Files

16

Last publish

Collaborators

  • avatar