@analytics/activity-utils

0.1.16 • Public • Published

Activity Utilities

User activity listener utility in 847 bytes

See live demo.

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)

Alternate libraries

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.1.164,612latest

Version History

VersionDownloads (Last 7 Days)Published
0.1.164,612
0.1.15435
0.1.142
0.1.1346
0.1.122
0.1.112
0.1.102
0.1.92
0.1.857
0.1.72
0.1.635
0.1.52
0.1.32
0.1.22
0.1.12
0.1.02
0.0.12

Package Sidebar

Install

npm i @analytics/activity-utils

Weekly Downloads

5,209

Version

0.1.16

License

MIT

Unpacked Size

88.9 kB

Total Files

16

Last publish

Collaborators

  • davidwells