IdleManager
Defined in: idle-manager.ts:35
Detects if the user has been idle for a duration of idleTimeout ms, and calls onIdle and registered callbacks.
By default, the IdleManager will log a user out after 10 minutes of inactivity.
To override these defaults, you can pass an onIdle callback, or configure a custom idleTimeout in milliseconds.
IdleManager is a singleton: multiple calls to create() return the same instance,
registering any new onIdle callback. Call exit() to tear down the singleton.
Methods
Section titled “Methods”exit()
Section titled “exit()”exit():
void
Defined in: idle-manager.ts:140
Tears down listeners, fires all callbacks, and clears the singleton.
Returns
Section titled “Returns”void
registerCallback()
Section titled “registerCallback()”registerCallback(
callback):void
Defined in: idle-manager.ts:133
Parameters
Section titled “Parameters”callback
Section titled “callback”IdleCB
function to be called when user goes idle
Returns
Section titled “Returns”void
create()
Section titled “create()”
staticcreate(options?):IdleManager
Defined in: idle-manager.ts:54
Creates or returns the singleton IdleManager.
If the instance already exists, any provided onIdle callback is registered
on the existing instance.
Parameters
Section titled “Parameters”options?
Section titled “options?”Optional configuration
captureScroll?
Section titled “captureScroll?”boolean
capture scroll events
Default
falseidleTimeout?
Section titled “idleTimeout?”number
timeout in ms
Default
10 minutes [600_000]onIdle?
Section titled “onIdle?”() => unknown
Callback after the user has gone idle
See
IdleCB
scrollDebounce?
Section titled “scrollDebounce?”number
scroll debounce time in ms
Default
100Returns
Section titled “Returns”IdleManager