Skip to content

Instantly share code, notes, and snippets.

View nemedib's full-sized avatar

Balázs Némedi nemedib

  • Hungary
View GitHub Profile
@nemedib
nemedib / +layout.svelte
Last active February 14, 2026 10:11
Typed async dialog store for Svelte shadcn dialogs. open() returns a Promise inferred from the dialog component’s close(result) prop. Includes a DialogHost renderer and example usage.
<script lang="ts">
import { DialogStore } from "$lib/context/dialog-store.svelte";
import DialogHost from "$lib/components/ui/dialog/dialog-host.svelte";
import { setContext } from "svelte";
setContext("dialog", new DialogStore());
</script>
<DialogHost />