mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-28 00:22:05 +00:00
fix!: don't await non-blocking strategies
This commit is contained in:
parent
8e18c1bdc0
commit
c07db7ee6f
@ -278,7 +278,7 @@ export function useAsyncData<
|
|||||||
|
|
||||||
// Allow directly awaiting on asyncData
|
// Allow directly awaiting on asyncData
|
||||||
const asyncDataPromise = Promise.resolve(nuxt._asyncDataPromises[key]).then(() => asyncData) as AsyncData<ResT, DataE>
|
const asyncDataPromise = Promise.resolve(nuxt._asyncDataPromises[key]).then(() => asyncData) as AsyncData<ResT, DataE>
|
||||||
Object.assign(asyncDataPromise, asyncData)
|
Object.assign(options.strategy === 'blocking' ? asyncDataPromise : Promise.resolve(asyncData), asyncData)
|
||||||
|
|
||||||
return asyncDataPromise as AsyncData<PickFrom<DataT, PickKeys>, DataE>
|
return asyncDataPromise as AsyncData<PickFrom<DataT, PickKeys>, DataE>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user