Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
feat(asyncData): handle immediate errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yutin1987 committed Aug 8, 2022
1 parent ee36ddf commit 49d808a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/composables/asyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 49d808a

Please sign in to comment.