event-trackr
v1.0.2
Published
Track events in an easy way
Downloads
3
Readme
event-trackr
Track events in an easy way
install
yarn add event-trackr
usage
- import event-trackr:
import eventTrackr from 'event-trackr'
- 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
- Fork it!
- Create your feature branch:
git checkout -b MY-NEW-FEATURE
- Commit your changes:
git commit -am 'ADD SOME FEATURE'
- Push to the branch:
git push origin MY-NEW-FEATURE
- Submit a pull request :D