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/swatch/EventLog/+page.svelte | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

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

diff --git a/ui/routes/(swatch)/.swatch/swatch/EventLog/+page.svelte b/ui/routes/(swatch)/.swatch/swatch/EventLog/+page.svelte
index a751ca3..eae0838 100644
--- a/ui/routes/(swatch)/.swatch/swatch/EventLog/+page.svelte
+++ b/ui/routes/(swatch)/.swatch/swatch/EventLog/+page.svelte
@@ -1,17 +1,16 @@
 <script>
   import EventCapture from '$lib/swatch/event-capture.svelte.js';
-  import { json } from '$lib/swatch/derive.js';
+  import * as json from '$lib/swatch/json.js';
 
   import EventLog from '$lib/components/swatch/EventLog.svelte';
 
   let eventsInput = $state(
-    JSON.stringify(
-      [{ event: 'example', args: ['argument a', 'argument b'] }],
-      /* replacer */ null,
-      /* space */ 2,
-    ),
+    json.encode([
+      { event: 'firstExample', args: ['argument a', 'argument b'] },
+      { event: 'secondExample', args: ['argument 1'] },
+    ]),
   );
-  let events = $derived(json(eventsInput));
+  let events = $derived(json.decode(eventsInput));
 
   let capture = $state(new EventCapture());
   const clear = capture.on('clear');
-- 
cgit v1.2.3

