Repository navigation
Add reactivity to useAsyncStoryblok #586
fedetorre
started this conversation in
Vue & Nuxt
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everybody,
I am integrating the Storyblok CMS into my company's website. I noticed that useAsyncStoryblok exposes all the options of Nuxt's useAsyncData, but the API params are not of type MaybeRefOrGetter.
This means that I can use the watch parameter to trigger a new fetch when a param changes (e.g. when the user switches the locale), but since the params are not reactive, useAsyncStoryblok triggers the old request twice.
I know this may be an edge case, but it is critical in components that do not re-render on API param changes.
For example, in my Nuxt application I use a static key to prevent the entire page from re-rendering on locale change for performance reasons (some data does not need to be fetched again). I achieved this by forcing the route key with definePageMeta:
What do you think? Could this be a valid enhancement?
All reactions