sd-track-core

0.1.2 • Public • Published

SD 统计封装

详见Git

安装使用

npm i sd-track-core@0.1.2 --save

Demo

创建

import {Tracker} from 'sd-track-core'
 
const tracker = new Tracker({
  showLog: true,
  commonParams: () => {
    return {
      biz: 'SDH',
      platform: '****',
    }
  },
  commonControlArg: {},
  // handleTrack: (trackData, controlArg) => {
  //   console.warn('统计怎么发可以重写,handleTrack: (trackData, controlArg) => {}')
  // }
})
 
export default tracker

调用

tracker.track({
  elementCode: 12345,
  extInfo: {
    id: 22,
    name: 'extName'
  }
})

扩展

更新日志

v0.1.2

npm ignore .babelrc

v0.1.1

rename tracker.wraper 2 tracker.wrapper

v0.1.0

修改api

v0.0.9

fix bug

Possible Unhandled Promise Rejection: TypeError: Cannot read property 'then' of undefined

v0.0.6

增加commonControlArg

Readme

Keywords

none

Package Sidebar

Install

npm i sd-track-core

Weekly Downloads

7

Version

0.1.2

License

ISC

Last publish

Collaborators

  • vsona
  • shuidifed