0.1.3 • Published 1 year ago

idle-tracker v0.1.3

Weekly downloads
414
License
MIT
Repository
github
Last release
1 year 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

1 year ago

0.1.2

2 years ago

0.1.0

2 years ago

0.1.1

2 years ago

0.0.8

3 years ago

0.0.7

4 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago