| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Detect when a user is idle or when he change tabs/apps. Small footprint package (5.47kb). Inspired by Idle.js
Install with npm/yarn:
npm install inactivejs
yarn add inactivejsImport on your js file:
const InactiveJS = require('inactivejs');
import InactiveJS from 'inactivejs';Instantiate:
const onAway = () => {
console.log('user is away');
};
const onBack = () => {
console.log('user is back');
};
const inactiveInstance = new InactiveJS({
timeout: 5000,
onAway: onAway,
onBack: onBack,
});Config options:
Available methods:
MIT.
| Back | FazBrowse Home | New Git URL |