Přesunuto na GitHub https://github.com/ksp/kurz
https://ksp.mff.cuni.cz/kurz
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
485 B
31 lines
485 B
4 years ago
|
<script lang="ts">
|
||
|
import type { TasksFile } from "./task-loader";
|
||
|
|
||
|
export let promise: Promise<TasksFile>;
|
||
|
|
||
|
|
||
|
let data: TasksFile | null = null;
|
||
|
let err: any | null = null;
|
||
|
promise.then(
|
||
|
(d) => {
|
||
|
data = d;
|
||
|
},
|
||
|
(e) => {
|
||
|
err = e;
|
||
|
}
|
||
|
)
|
||
|
|
||
|
</script>
|
||
|
|
||
|
{#if data == null && err == null}
|
||
|
<div>Loading...</div>
|
||
|
{/if}
|
||
|
|
||
|
{#if data != null }
|
||
|
<slot {data} />
|
||
|
{/if}
|
||
|
|
||
|
{#if err != null }
|
||
|
<div>Error - {err}</div>
|
||
|
{/if}
|