@analytics/activity-utils
v0.1.16
Published
User activity listener utilities
Downloads
15,915
Maintainers
Readme
Activity Utilities
User activity listener utility in 847 bytes
import { onIdle, onWakeUp } from '@analytics/activity-utils'
const FIVE_MINUTES = 300e3
const opts = {
timeout: FIVE_MINUTES,
}
onIdle((activeTime) => {
console.log('Ive been idle for 5 minutes', activeTime)
}, opts)
onWakeUp(() => {
console.log('Yay wake up, user is back')
}, opts)