I am writing a Svelte CSR application. I am wondering whether this is ok:
<script> const data = api.getDataAsync()<script>{#await data}<span>Loading</span>{:then data} //display data{/await}
If not why? should I do it the react way
<script> let data = $state(undefined) onMount(()=>{ api.getDataSync().then(apiData=>data=apiData) })</script>{#if !data}<span>loading...</span>{:else} //display data{/if}
Edit: Because I am using PocketBase, I have SSR turned off.