site-panzai/node_modules/nuxt/dist/app/composables/asyncContext.js

8 lines
287 B
JavaScript
Raw Permalink Normal View History

2026-11-13 13:57:04 +01:00
import { getCurrentInstance, withAsyncContext as withVueAsyncContext } from "vue";
export function withAsyncContext(fn) {
return withVueAsyncContext(() => {
const nuxtApp = getCurrentInstance()?.appContext.app.$nuxt;
return nuxtApp ? nuxtApp.runWithContext(fn) : fn();
});
}