I am new to Svelte and want to do something like this in my +page.js:
export async function load() { let prom = new Promise((res) => { setTimeout(() => res('myData'), 10000) }) let value = await prom return { value }}And the following is my +page.svelte:
<script> export let data</script>{#if data?.value}<pre>data is {data.value}</pre>{:else}<pre>data is Loading...</pre>{/if}But, I am not getting the :else part on my page at all. Instead, the entire page keeps loading for a whole 10sec and then flashes the data value directly. How can I achieve the expected?