actr
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

ActivityTracker

用于追踪用户状态工具类

Installtion

npm i actr

Usage

import Actr from 'actr'

const tracker = new Actr({
  idleThreshold: 10000,
  onIdle: () => console.log('空闲状态')
})

// 记录操作
tracker.track('clicked_button')

Props

参数名 说明 类型 必填 默认值
idleThreshold 空闲阈值 number 10000(毫秒)
onActive 非空闲回调 function (d: { name: string, timestamp: number }) => {}
onIdle 空闲回调 function () => {}

Method

方法名 描述 参数
track 记录方法 name: string
destroy 清空活动记录 -

Package Sidebar

Install

npm i actr

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

5.97 kB

Total Files

6

Last publish

Collaborators

  • iamgx