Refresh result of useAsyncData
with immediate : false
when navigation occurs
#20979
Closed
3 of 4 tasks
Labels
Describe the feature
I opened a discussion #20885 a few days ago, no one answered so I decided to dig into that. I was exploring
Nuxt
and found some clues of my questions.Since nuxt/framework#8885, when navigation occurs on client-side,
useAsyncData
ignores cached data and makes a new call (#15445). However, I found that whenoptions
getsimmediate : false
, It uses cached data first. I am not sure it is intended behavior but because of nuxt/framework#8885, the result has to be the same regardless ofimmediate
's value. Which means, whenuseAsyncData
withimmediate : false
option, callrefresh
method, move to other page and come back, the result ofuseAsyncData
has to beundefined
first, not cached data because it wasundefined
on the first page loaded.Additionally, if
useAsyncData
withlazy: true, default : () => value
, it shows default value for the first page loaded, but after moving to other page and coming back, it shows cached data first Instead of default value. I've considered that this is also related to above issue.Additional information
Final checks
The text was updated successfully, but these errors were encountered: