UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

12 lines (11 loc) 380 B
import { getCurrentInstance, withAsyncContext as withAsyncContext$1 } from "vue"; //#region src/app/composables/asyncContext.ts /** @since 3.8.0 */ function withAsyncContext(fn) { return withAsyncContext$1(() => { const nuxtApp = getCurrentInstance()?.appContext.app.$nuxt; return nuxtApp ? nuxtApp.runWithContext(fn) : fn(); }); } //#endregion export { withAsyncContext };