1.1.8 • Published 2 years 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-detectorHow 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.timeouttime in milliseconds which will triggeronIdleactivityEvents: 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
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
3 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.2
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
0.0.14
4 years ago
0.0.15
4 years ago
0.0.16
4 years ago
0.0.17
4 years ago
0.0.10
4 years ago
0.0.11
4 years ago
0.0.12
4 years ago
0.0.13
4 years ago
0.0.9
4 years ago
0.0.8
4 years ago
0.0.6
4 years ago
1.0.0
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