0.0.7 • Published 3 years ago

idle-tracker-patched v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Demo

** Browser might the function natively in the future, see Idle Detection API

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 }
throttlenumber500throttle rate of callback