This PR fixes bug of usage timeline option with useAsyncData with lazy: true
Type of change
[x] 🐞 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:
After use useAsyncData() with metrics wrapper returning value is only promise, example with timeline enabled:
Without timeline: { enabled: true } } all working as expected
This happens, because .finally() returns only Promise, without additional attributes, added by useAsyncData()
This PR fixes bug of usage
timeline
option withuseAsyncData
withlazy: true
Type of change
Description
Case if bug:
useAsyncData
returns only promise, without data, pending and othersReproduction
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, likedata
,pending
,error
, example:After use
useAsyncData()
with metrics wrapper returning value is only promise, example with timeline enabled:Without
timeline: { enabled: true } }
all working as expectedThis happens, because
.finally()
returns only Promise, without additional attributes, added byuseAsyncData()
Looking for feedback about fix :)