Basic loader reload #610
-
Hello! When using basic loader how do I change route query without triggering data loader reload? I just want to change one query param without data loader rerun. Is it possible? Like an option in data loader to turn off automatic rerun or something. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
You can use the colada loader which does support it out of the box (if the query is not used, it won't reload) |
Beta Was this translation helpful? Give feedback.
-
But still I need an option to exclude route query params from triggering data refresh. It will cover some of my edge cases where I just need to remove a query param WITHOUT refreshing data. Or to choose what should trigger refresh, like |
Beta Was this translation helpful? Give feedback.
So you see a
refresh()
of the data (based on the slateTime of the data) after 5s which is expected. The default value of staleTime is 5 seconds but it can be made bigger if your data doesn't requires to be considered stale that often:The colada loader does have a mechanism where it will reload if the route changed. Initially I didn't add that behavior to the basic loader but I might add it. Note that
useAsyncData()
always refetch, it doesn't track the route changes and that you can still data loaders with Nuxt!