JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5999
  • Score
    100M100P100Q127762F
  • License MIT

Pure Javascript library to track browser inactivity

Package Exports

  • idle-tracker

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (idle-tracker) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Idle Tracker

idle tracker
npm gzip size downloads circleci

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