0.1.3 • Published 2 years ago

idle-tracker v0.1.3

Weekly downloads
414
License
MIT
Repository
github
Last release
2 years ago

Demo

Browsers support

IE / EdgeFirefoxChromeSafariiOS SafariSamsungOpera
Edgelast versionlast 2 versionslast 2 versionslast 2 versionslast 2 versionslast 2 versions

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 NameTypeDefaultDescription
timeout (ms)number30000timeout to count as idle
onIdleCallbackFunctionnoopFunction to be called when idle status change, payload will be { idle: true/false }, with optional event payload
throttlenumber500throttle rate of callback

Future

  1. Browser might support this function natively in the future, see Idle Detection API
  2. Related newer API/Library: page-lifecycle, repo
0.1.3

2 years ago

0.1.2

3 years ago

0.1.0

3 years ago

0.1.1

3 years ago

0.0.8

4 years ago

0.0.7

5 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago