1.0.2 • Published 6 years ago

event-trackr v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

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