🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more
Socket
Book a DemoInstallSign in
Socket

@zhike/sa-hoc-wrapper

Package Overview
Dependencies
Maintainers
9
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zhike/sa-hoc-wrapper

智课神策业务打点数据包

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
9
Created
Source

SA-HOC-WRAPPER

基于神策的业务高阶组件 暂时只在题库项目中使用

使用

  npm i @zhike/sa-hoc-wrapper
import { saWrapper } from '@zhike/sa-hoc-wrapper';

@saWrapper({
  eventName: 'ti-practice-ielts'
})
class extends Component{
  getTrackTimerProperties(){
    return {
      name: '测试',
    }
  }
}

开发指南

 # 开启服务
 npm start 

 # 编译打包 
 npm run build

 # 更新版本号
 npm version major|minor|patch
 
 # 发布
 npm publish --access public

API

配置参数

{
  "eventName": "ti-practice-ielts",
  "durationType": "min", 
}
// 返回神策打点属性
getTrackTimerProperties(){
  return {
    name: '1',
    age: '18',
  }
} 

默认会将当前包裹组件的 componentDidmount 和 compoentwillunmount 之间的时间 duration 自动上传

Keywords

zhike

FAQs

Package last updated on 19 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts