1.1.8 • Published 7 months ago
react-activity-detector v1.1.8
react-activity-detector 😴
Small and simple library to check if the user is idle.
Install
$ npm install --save react-activity-detector
How to use
Basic example
import ActivityDetector from 'react-activity-detector';
const customActivityEvents = [
'click',
'keydown',
];
const onIdle = () => {
console.log("The user seems to be idle...");
}
const onActive = () => {
console.log("The user is active!");
}
<ActivityDetector activityEvents={customActivityEvents} enabled={true} timeout={5*1000} onIdle={onIdle} onActive={onActive} name="default"/>
Parameter options
enabled
: Boolean value indicating if the A.D. is enabled.timeout
time in milliseconds which will triggeronIdle
activityEvents
: events used to detect if the user is active. Default list of Activity Events is['click', 'mousemove', 'keydown', 'DOMMouseScroll', 'mousewheel', 'mousedown', 'touchstart', 'touchmove', 'focus']
. If none event is sent the list will consume the default one.name
: in need of multiple Activity Detectors, provide a custom name. Default value isdefault
.
1.1.8
7 months ago
1.1.7
12 months ago
1.1.6
12 months ago
1.1.5
1 year ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.1.1
3 years ago
1.1.0
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.10
3 years ago
0.0.11
3 years ago
0.0.12
3 years ago
0.0.13
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.6
3 years ago
1.0.0
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago