mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-05 11:57:13 +00:00
20 lines
328 B
TypeScript
20 lines
328 B
TypeScript
const delay = () => new Promise(resolve => setTimeout(resolve, 10))
|
|
|
|
export async function nestedAsyncComposable () {
|
|
await delay()
|
|
return await fn1()
|
|
}
|
|
|
|
async function fn1 () {
|
|
await delay()
|
|
return await fn2()
|
|
}
|
|
|
|
async function fn2 () {
|
|
await delay()
|
|
const app = tryUseNuxtApp()
|
|
return {
|
|
hasApp: !!app,
|
|
}
|
|
}
|