Skip to content

fix(timeline-helper-wrapper): Fix return value in timeline wrapper for promises#567

Merged
antfu merged 1 commit intonuxt:mainfrom
Vespand:main
Jan 8, 2024
Merged

fix(timeline-helper-wrapper): Fix return value in timeline wrapper for promises#567
antfu merged 1 commit intonuxt:mainfrom
Vespand:main

Conversation

@Vespand
Copy link
Copy Markdown
Contributor

@Vespand Vespand commented Jan 8, 2024

This PR fixes bug of usage timeline option with useAsyncData with lazy: true

Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)

Description

Case if bug:

  • useAsyncData returns only promise, without data, pending and others

Reproduction

  • Reproduction branch - added reproduction in ./playgrounds/empty (JFI - it only works on local machine, in stackblitz timeline metrics can't be enabled)
  • useAsyncData() return not only promise, it also return a lot additional attributes, like data, pending, error, example:
image
  • After use useAsyncData() with metrics wrapper returning value is only promise, example with timeline enabled:
image
  • Without timeline: { enabled: true } } all working as expected

This happens, because .finally() returns only Promise, without additional attributes, added by useAsyncData()

Looking for feedback about fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants