You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We had the ability to force refresh asyncData state using refresh(true). It had been removed in nuxt/framework#699 to make refresh API forward compatible using an object syntax ({ force: true }) but also probably reimplement.
The main issue with refreshing while another promise is running is that we are not canceling the previous one. (and there is no standard spec for cancelable promises).
For useFetch, it is completely doable and we can use cancelation tokens to automatically cancel previous ones.
For useAsyncData as handler function that runs promise is black box, we need to find a way to reject stalled promise when it resolved and keep it in an alternative place for asyncDatas.
The text was updated successfully, but these errors were encountered:
I'm using the refresh method from useAsyncData for an autocomplete input usage. As I need to fire refresh on every user input, which can happen before last refresh has finished, I need to force the refresh.
Is there still a way to achieve this ?
I tried with refresh(true) (as said in docs) and refresh({force: true}) but neither of them seem to work.
(from various references and nuxt/framework#5738 by @OhB00)
We had the ability to force refresh asyncData state using
refresh(true)
. It had been removed in nuxt/framework#699 to make refresh API forward compatible using an object syntax ({ force: true }
) but also probably reimplement.The main issue with refreshing while another promise is running is that we are not canceling the previous one. (and there is no standard spec for cancelable promises).
For useFetch, it is completely doable and we can use cancelation tokens to automatically cancel previous ones.
For useAsyncData as handler function that runs promise is black box, we need to find a way to reject stalled promise when it resolved and keep it in an alternative place for asyncDatas.
The text was updated successfully, but these errors were encountered: