I'd like to use convenient #await
Svelte helper when loading data with fetch()
.
However, I noticed a warning at onMount tutorial [1]:
It's recommended to put the fetch in onMount rather than at the top level of the
<script>
because of server-side rendering (SSR).
I don't need SSR, but wanted to try it out. Hovewer, onMount()
doesn't return a Promise, and I cannot create a Promise that resolves with onMount()
.
Is it possible to use onMount()
together with #await
?