mirror of https://github.com/sveltejs/svelte
19 lines
342 B
19 lines
342 B
<script>
|
|
export let thePromise;
|
|
</script>
|
|
|
|
{#await thePromise}
|
|
<p>loading...</p>
|
|
{:then theValue}
|
|
<p>the value is {theValue}</p>
|
|
{:catch theError}
|
|
<p>oh no! {theError.message}</p>
|
|
{/await}
|
|
|
|
{#await thePromise}
|
|
<p>loading...</p>
|
|
{:then theValue}
|
|
<p>the value is {theValue}</p>
|
|
{:catch theError}
|
|
<p>oh no! {theError.message}</p>
|
|
{/await} |