Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support computed keys for data fetching composables #14583

Closed
danielroe opened this issue Aug 15, 2022 · 1 comment
Closed

support computed keys for data fetching composables #14583

danielroe opened this issue Aug 15, 2022 · 1 comment

Comments

@danielroe
Copy link
Member

There are a number of cases where users want to pull data in (often based on route parameters) and dynamically update this data as things change. (For example, #14581, #14342, #14493.)

It would be useful to add support for computed keys in useFetch and useAsyncData so that the original data fetched isn't overwritten but rather a new key/asyncdata value is accessed based on the computed key. This would also have the effect of meaning that initialCache would not have to be set to false to enable updates on route navigation.

@pi0
Copy link
Member

pi0 commented Aug 15, 2022

One major issue with supporting computed keys, is that we might endup with (mostly client-side) memory leaks when input dynamically changes. There might be better ways to overcome with limitations of dynamic route keys (like using a subkey). Let's wait for it until fixing asyncData shared state.

@pi0 pi0 added the discussion label Aug 15, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe transferred this issue from nuxt/framework Jan 19, 2023
@danielroe danielroe closed this as not planned Won't fix, can't repro, duplicate, stale Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants