Resets the IdleTimer instance to its initial state and starts the timer.
Methods
Methods are the API that is returned by IdleTimer. You can interface with your IdleTimer instance by using the following functions. Examples of how to use them can be found in the hook and higher order component docs.
start#
() => void
reset#
Resets the IdleTimer instance to its initial state.
() => void
activate#
Resets the IdleTimer instance to its initial state, starts the timer and emits onActive
if the user was idle.
() => void
pause#
Pauses the IdleTimer instance. When paused all events are unbound.
() => void
resume#
Resumes an IdleTimer instance from the time it was paused. When resumed, all events will be bound.
() => void
message#
Broadcast an arbitrary message to all instances of IdleTimer. If crossTab is enabled, all tabs will receive the message and their onMessage
callback will be emitted. If emitOnSelf
is set to true, the callee instance will also emit its onMessage
callback.
(data: MessageType, emitOnSelf?: boolean) => void
isIdle#
Returns whether or not the user is idle.
() => boolean
isPrompted#
Returns whether or not the prompt is active.
() => boolean
isLeader#
Returns whether or not current tab is the leader.
() => boolean
getTabId#
Returns the current tabs id.
() => string
getRemainingTime#
Returns the number of milliseconds until idle.
() => number
getElapsedTime#
Returns the number of milliseconds since the hook was mounted.
() => number
getTotalElapsedTime#
Returns the number of milliseconds since the hook last reset.
() => number
getLastIdleTime#
Returns the last time the user was idle. Returns a Date instance that can be formatted.
() => Date | null
getLastActiveTime#
Returns the last time the user was active. Returns a Date instance that can be formatted.
() => Date | null
getTotalIdleTime#
Returns the total time in milliseconds user has been idle.
() => number
getTotalActiveTime#
Returns the total time in milliseconds user has been active.
() => number