You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the latest versions useAsyncStoryblok returns only the story. You cannot control the useAsyncData that is inside the useAsyncStoryblok at all. For example, you would like to instruct lazy or client only fetching.
To be more in line with the way nuxt composables like useAsyncData or useFetch work the useAsyncStoryblok should return the object that contains the usual data, pending, etc properties. One could also provide the AsyncDataOptions for the composable.
This would be a breaking change and thus needs more discussion.
I can submit a PR for this if the idea sounds solid.
Suggested solution or improvement
This implementation of useAsyncStoryblok should work as described above.
This could be then called like this (from playground folder):
const { data: story, pending } = await useAsyncStoryblok(`vue/articles/${path.params.slug}`, {
version: "draft",
language: "en"
}, {},
{ server: false, lazy: true, dedupe: "defer" }); // <- any asyncData options to give the control to the dev
alvarosabu
added
bug
[Issue] Something isn't working
p3
and removed
pending-author
[Issue] Awaiting further information or action from the issue author
bug
[Issue] Something isn't working
labels
Jul 2, 2024
Description
In the latest versions
useAsyncStoryblok
returns only the story. You cannot control theuseAsyncData
that is inside theuseAsyncStoryblok
at all. For example, you would like to instruct lazy or client only fetching.To be more in line with the way nuxt composables like
useAsyncData
oruseFetch
work theuseAsyncStoryblok
should return the object that contains the usualdata
,pending
, etc properties. One could also provide theAsyncDataOptions
for the composable.This would be a breaking change and thus needs more discussion.
I can submit a PR for this if the idea sounds solid.
Suggested solution or improvement
This implementation of
useAsyncStoryblok
should work as described above.This could be then called like this (from playground folder):
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: