1.0.8 • Published 6 months ago

actr v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

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空闲阈值number10000(毫秒)
onActive非空闲回调function(d: { name: string, timestamp: number }) => {}
onIdle空闲回调function() => {}

Method

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