TanStackT
TanStack3y ago
4 replies
ordinary-sapphire

Query on user action while respecting cache

Hi everyone !
I'm trying out Vue (Nuxt) and tanstack query currently, and I'm trying to create a query that only fetch data when a user makes an action (ex: a search when the user click on a submit button). For that, I use enable: false and the refetch() method, but, unless I'm mistaken, this method ignore the cache and the request is fired every time. Is there a way to make it work ?
Was this page helpful?