looks really nice ! I was about to do some stuff like this
I think asyncData can be used without async/await.
Also in you post you can set the language in 'code' markdown tag, so the code will be displayed with some colors :D
Hey Thomas, I just revisited my code and you do need async/await on the asyncData method or the data caught in the stories variable below is a pending promise, causing the page to fail.
let blogPosts = await contentful.getEntries({ content_type: "blogPost" });
looks really nice ! I was about to do some stuff like this
I think asyncData can be used without async/await.
Also in you post you can set the language in 'code' markdown tag, so the code will be displayed with some colors :D
Oh awesome, thank you! I'll have a look and ammend this later today :)
Hey Thomas, I just revisited my code and you do need async/await on the asyncData method or the data caught in the stories variable below is a pending promise, causing the page to fail.
let blogPosts = await contentful.getEntries({ content_type: "blogPost" });
:)
yes ! I meant like this !
i'm pretty sure it would do the exact same thing :)
I use it that way with axios module.
Ah gotcha! Thanks for the tip 👍