angular-simple-user-idle
Service for Angular 6+ to detect and control of user's idle.
Important
This library is a fork of angular-user-idle by rednez
Installation (outdated)
npm install angular-user-idle
In app.module.ts:
;; ; ;
Usage (outdated)
You should init user idle service in one of core component or service of your app, for example login.component.ts:
;;
API (outdated)
startWatching(): void;
Start user idle service and configure it.
onTimerStart(): Observable<number>
Fired when timer is starting and return observable (stream) of timer's count.
onTimeout(): Observable<boolean>;
Fired when time is out and id user did not stop the timer.
stopTimer()
Stop timer.
resetTimer()
Reset timer after onTimeout() has been fired.
stopWatching()
Stop user idle service.
setConfigValues({idle, timeout, ping})
Set config values after module was initialized.
setCustomActivityEvents(customEvents: Observable<any>): void
Set custom activity events after module was initialized.
Service logic: (outdated)
- User is inactive for 10 minutes
onTimerStart()
is fire and return countdown for 5 minutes- If user did not stop timer by
stopTimer()
then time is up andonTimeout()
is fire.