From a5326a67e37d9f1aee740f7b3d46345f3bcda419 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Wed, 9 Jul 2025 23:29:06 -0400
Subject: Factor data-to-JSON-string construction out of stitches.

This is a recurring and nameable operation; let's give it a name before we use it further.
---
 ui/routes/(swatch)/.swatch/Invites/+page.svelte | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'ui/routes/(swatch)/.swatch/Invites/+page.svelte')

diff --git a/ui/routes/(swatch)/.swatch/Invites/+page.svelte b/ui/routes/(swatch)/.swatch/Invites/+page.svelte
index 8c24627..bc4bdb1 100644
--- a/ui/routes/(swatch)/.swatch/Invites/+page.svelte
+++ b/ui/routes/(swatch)/.swatch/Invites/+page.svelte
@@ -1,14 +1,12 @@
 <script>
-  import { json } from '$lib/swatch/derive.js';
+  import * as json from '$lib/swatch/json.js';
   import EventCapture from '$lib/swatch/event-capture.svelte.js';
 
   import EventLog from '$lib/components/swatch/EventLog.svelte';
   import Invites from '$lib/components/Invites.svelte';
 
-  let invitesInput = $state(
-    JSON.stringify([{ id: 'Iaaaa' }, { id: 'Ibbbb' }], /* replacer */ null, /* space */ 2),
-  );
-  let invites = $derived(json(invitesInput));
+  let invitesInput = $state(json.encode([{ id: 'Iaaaa' }, { id: 'Ibbbb' }]));
+  let invites = $derived(json.decode(invitesInput));
 
   let capture = $state(new EventCapture());
   const createInvite = capture.on('createInvite');
-- 
cgit v1.2.3

