Skip to content

Commit

Permalink
Remove top-level await from tools story
Browse files Browse the repository at this point in the history
  • Loading branch information
addisonbeck committed Oct 17, 2023
1 parent 16c1908 commit 06e3b9e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 21 deletions.
27 changes: 27 additions & 0 deletions src/lib/components/SiteTools.stories.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<script context="module">
import SiteTools from './SiteTools.svelte';
import { Story } from '@storybook/addon-svelte-csf';
export const meta = {
title: "Components/Home/Site Tools",
component: SiteTools,
tags: ['autodocs']
}
</script>

<Story name="Default">
<SiteTools></SiteTools>
</Story>

<script lang="ts">
async function load() {
const tools = await (await import ('../data/SiteTools')).default();
return tools;
}
</script>

<Story name="Hydrated">
{#await load() then tools}
<SiteTools tools={tools}></SiteTools>
{/await}
</Story>
20 changes: 0 additions & 20 deletions src/lib/components/SiteTools.stories.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/lib/components/SiteTools.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import Table from './Table.svelte'
import TableRow from './TableRow.svelte'
import TableRowItem from './TableRowItem.svelte'
export let tools: SiteTools;
export let tools: SiteTools | undefined = undefined;
</script>

{#if tools}
Expand Down

0 comments on commit 06e3b9e

Please sign in to comment.