event-trackr

1.0.2 • Public • Published

event-trackr

Track events in an easy way

install

yarn add event-trackr

usage

  1. import event-trackr:
import eventTrackr from 'event-trackr'
  1. tell event-trackr which nodes & what events you wanna track:
new eventTrackr([{
  node:  'video',
  play:  'play_vdo',
  pause: 'pause_vdo',
  end:   'end_vdo'
}, {
  node:  '.img',
  ready: 'img_ready',
  show:  'img_show',
  hide:  'img_hide'
}], handleEventFunc)
 
function handleEventFunc(event) {
  // collect and send to server or whatever you want
}

todo

  • code comments
  • promises
  • example

contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b MY-NEW-FEATURE
  3. Commit your changes: git commit -am 'ADD SOME FEATURE'
  4. Push to the branch: git push origin MY-NEW-FEATURE
  5. Submit a pull request :D

Readme

Keywords

Package Sidebar

Install

npm i event-trackr

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • gaoryrt