Elegant Async/Await Pattern for API Requests (10/10 - Svelte Crash Course)

preview_player
Показать описание
It's super easy to do asynchronous stuff like API requests with Svelte.

We can simply await a Promise to resolve, displaying a "loading" placeholder before the result is ready.

Note that we await the Promise in the template section, so no await keyword in script section.

======

#javascript #svelte #webdevelopment #programming #sveltejs
Рекомендации по теме
Комментарии
Автор

yep simple et elegant, Svelte in one adjective ! ;-)

libertady
welcome to shbcf.ru