Closed SinanMtl closed 3 years ago
With this PR, we can access the instance after registration.
wait.js
import { createVueWait } from 'vue-wait'
const VueWait = createVueWait({ useVuex: false, registerComponent: true })
export const wait = VueWait.instance export default VueWait
2. Register vue-wait to app ```js import { createApp } from 'vue' import App from './App.vue' import VueWait from './wait.js' createApp(App).use(VueWait)
import { wait } from './wait.js'
async function foo() { wait.start('foo')
await sendFoo()
wait.end('foo') }
Thus, you can create wait anywhere and can be use any place in your code.
With this PR, we can access the instance after registration.
wait.js
const VueWait = createVueWait({ useVuex: false, registerComponent: true })
export const wait = VueWait.instance export default VueWait
async function foo() { wait.start('foo')
await sendFoo()
wait.end('foo') }