wideangle-nuxt/src/runtime/composables/useWaaEvent.ts
2023-05-18 12:33:46 +00:00

10 lines
305 B
TypeScript

import { useNuxtApp } from '#imports';
export function useWaaEvent (name: string, params?: Record<string, any>) {
const waa = useNuxtApp().$waa
if(waa && waa.value) {
waa.value.dispatchEvent(name, params);
} else {
console.debug("[WAA] Wide Angle Analytics is not yest initialized");
}
}