Skip to content
This repository has been archived by the owner on Jun 12, 2024. It is now read-only.

Commit

Permalink
feat: exports all library
Browse files Browse the repository at this point in the history
adds possibility to access the vue-analytics library from outside the Vue scope

closes #151
  • Loading branch information
MatteoGabriele committed Aug 27, 2018
1 parent bad42a0 commit 1758db6
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
import bootstrap from './bootstrap'
import lib from './lib'
import { update } from './config'
import { onAnalyticsReady } from './helpers'
import * as helpers from './helpers'
import ga from 'directives/ga'
import * as exception from 'lib/exception'
import analyticsMiddleware from './vuex-middleware'
import { autotracking as expectionAutotracking } from 'lib/exception'
import vuexMiddleware from './vuex-middleware'

export default function install (Vue, options = {}) {
update({ ...options, $vue: Vue })

Vue.directive('ga', ga)

Vue.prototype.$ga = Vue.$ga = lib

exception.autotracking(Vue)

expectionAutotracking(Vue)
bootstrap()
}

export {
onAnalyticsReady,
analyticsMiddleware
}
// Vuex middleware
export const analyticsMiddleware = vuexMiddleware

// Helpers
export const onAnalyticsReady = helpers.onAnalyticsReady

// Event library
export const event = lib.event
export const ecommerce = lib.ecommerce
export const set = lib.set
export const page = lib.page
export const query = lib.query
export const screenview = lib.screenview
export const time = lib.time
export const require = lib.require
export const exception = lib.exception
export const social = lib.social


0 comments on commit 1758db6

Please sign in to comment.