mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(nuxt): handle immediate errors when calling useAsyncData
(#6441)
This commit is contained in:
parent
ae388e7293
commit
03cd6717ce
@ -131,8 +131,8 @@ export function useAsyncData<
|
||||
}
|
||||
asyncData.pending.value = true
|
||||
// TODO: Cancel previous promise
|
||||
// TODO: Handle immediate errors
|
||||
nuxt._asyncDataPromises[key] = Promise.resolve(handler(nuxt))
|
||||
nuxt._asyncDataPromises[key] = Promise.resolve()
|
||||
.then(() => handler(nuxt))
|
||||
.then((result) => {
|
||||
if (options.transform) {
|
||||
result = options.transform(result)
|
||||
|
Loading…
Reference in New Issue
Block a user