posva / pinia-colada

🍹 The smart data fetching layer for Pinia
https://pinia-colada.esm.dev/
MIT License
584 stars 7 forks source link

Add `autoRefetch` Option to `useQuery` for automatic stale entry refetching #49

Open quiteeasy opened 1 month ago

quiteeasy commented 1 month ago

Add a boolean option, autoRefetch, to automatically refetch an entry when it becomes stale.

posva commented 1 month ago

Interesting. This could be useful as a plugin once more stuff is exposed. I see it as a dangerous default as it would spam the server very often

quiteeasy commented 1 month ago

Adding this as an option would be useful, but I would not set it to true by default

posva commented 1 month ago

If it's added, it should be fully tree shakable too

quiteeasy commented 1 month ago

Should we add an option to QueryPlugin or possibly another plugin (perhaps as a separate package) to enable autoRefetch across the app, while still allowing control through each individual useQuery options? This approach would ensure it is tree-shakable and maintains flexibility

posva commented 1 month ago

We will see later on but probably a different kind of plugin. I think a lot of other more critical features are still missing before this 😄