0.0.7 • Published 4 years ago
idle-tracker-patched v0.0.7
** Browser might the function natively in the future, see Idle Detection API
Installation
via yarn
$ yarn add idle-trackeror via npm
$ npm install idle-trackerUsage
import IdleTracker from 'idle-tracker';
const idleTracker = new IdleTracker(options);
idleTracker.start(); // start tracker
idleTracker.end(); // stop tracker and release memoryConstructor 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 |
0.0.7
4 years ago