MCPcopy
hub / github.com/nuxt/nuxt / tryUseNuxtApp

Function tryUseNuxtApp

packages/nuxt/src/app/nuxt.ts:559–568  ·  view source on GitHub ↗
(id?: string)

Source from the content-addressed store, hash-verified

557 */
558export function tryUseNuxtApp (): NuxtApp | null
559export function tryUseNuxtApp (id?: string): NuxtApp | null {
560 let nuxtAppInstance
561 if (hasInjectionContext()) {
562 nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt
563 }
564
565 nuxtAppInstance ||= getNuxtAppCtx(id).tryUse()
566
567 return nuxtAppInstance || null
568}
569
570/* @__NO_SIDE_EFFECTS__ */
571/**

Callers 2

useNuxtAppFunction · 0.85
fn2Function · 0.85

Calls 1

getNuxtAppCtxFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…