Skip to content

Latest commit

 

History

History
258 lines (148 loc) · 3.76 KB

File metadata and controls

258 lines (148 loc) · 3.76 KB

Table of Contents

props

timeout

Activity Timeout in milliseconds default: 1200000

Type: Number

events

DOM events to listen to default: see default events

Type: Array

onIdle

Function to call when user is idle default: () => {}

Type: Function

onActive

Function to call when user becomes active default: () => {}

Type: Function

onAction

Function to call on user actions default: () => {}

Type: Function

debounce

Debounce the onAction function by setting delay in milliseconds default: 0

Type: Number

throttle

Throttle the onAction function by setting delay in milliseconds default: 0

Type: Number

element

Element reference to bind activity listeners to default: document

Type: Object

startOnMount

Start the timer on mount default: true

Type: Boolean

stopOnIdle

Once the user goes idle the IdleTimer will not reset on user input instead, reset() must be called manually to restart the timer default: false

Type: Boolean

passive

Bind events passively default: true

Type: Boolean

capture

Capture events default: true

Type: Boolean

methods

reset

Restore initial state and restart timer

pause

Store remaining time and stop timer

resume

Resumes a paused timer

getRemainingTime

Time remaining before idle

Returns Number Milliseconds remaining

getElapsedTime

How much time has elapsed

Returns Timestamp

getLastActiveTime

Last time the user was active

Returns Timestamp

isIdle

Returns wether or not the user is idle

Returns Boolean

utilities

debounced

Creates a debounced function that delays invoking func until after delay milliseconds has elapsed since the last time the debounced function was invoked.

Parameters

Returns Function Executed Function *

throttled

Creates a throttled function that only invokes func at most once per every wait milliseconds.

Parameters

Returns Function Executed Function *