Injecting WAA via ref to account for load delay.
This commit is contained in:
parent
30c0b72eea
commit
ef6770f031
6 changed files with 49 additions and 15 deletions
10
index.js
10
index.js
|
@ -1,9 +1,15 @@
|
|||
import { initWideAngle } from "./src";
|
||||
import { ref } from 'vue';
|
||||
|
||||
export default {
|
||||
install: (app, options) => {
|
||||
install: async (app, options) => {
|
||||
const waaRef = ref()
|
||||
app.provide('waa', waaRef);
|
||||
initWideAngle(options)
|
||||
.then(waa => { app.provide('waa', waa); })
|
||||
.then(waa => {
|
||||
waaRef.value = waa;
|
||||
console.debug("[WAA] Wide Angle Analytics instance available");
|
||||
})
|
||||
.catch(e => { console.error("Failed to load Wide Angle Plugin", e)});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue