I always find it frustrating when I'm learning a new framework and I get to the point where I have to depart from my existing knowledge and princip...
For further actions, you may consider blocking this person and/or reporting abuse
Hi David,
Using a promise to fetch, you could use
await blocks
.Have a look at this: svelte.dev/tutorial/await-blocks
Agreed. {#await...then...catch} is the preferred way to do this, especially considering the fetch is already within an async function, which will return a promise.
I really appreciate that I don't need to learn "the svelty way" for fetching data. You explained it very well, David!
I just wanted to add that on more complex scenarios; It could be a good alternative to handle all the data fetching on services to reuse functions from different components.
Great post! We need more people sharing their experiences with Svelte!
Totally agree! In a more complex scenario, i think you want to completely separate data calls from components.
You could also just use
await
blocks offered by Svelte :)Very cool! I haven’t had a chance to use these yet
github.com/SvelteStack/svelte-query
Very good examples, Thanks for this article.
Thanks Pavel!
Nice one bro
Thanks Kinanee