From 481cc8cf68e5f8495038e6f9fb2e56d5bc509a15 Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Fri, 4 Aug 2023 14:11:55 +0200 Subject: [PATCH] added loading and passing of svelte state stores to the machine context --- .../components/refactor/ComposerCharly.svelte | 21 ++++++++----------- .../components/refactor/ComposerWrap.svelte | 10 ++++----- src/lib/core/refactor/coreServices.ts | 16 +++++++------- 3 files changed, 22 insertions(+), 25 deletions(-) diff --git a/src/lib/components/refactor/ComposerCharly.svelte b/src/lib/components/refactor/ComposerCharly.svelte index 6739bca..ae0b6de 100644 --- a/src/lib/components/refactor/ComposerCharly.svelte +++ b/src/lib/components/refactor/ComposerCharly.svelte @@ -1,23 +1,17 @@ -
+

My ID is: {me.id}

my state is {$data.state}

I am charly

- my data.context prop: {JSON.stringify($data.context)} + my data.context.hello prop: {JSON.stringify($data.context.hello)}
- - +
+ {#if $data.context.messages} + {#each $data.context.messages as message} +

{message.text}

+ {/each} + {/if} +
diff --git a/src/lib/components/refactor/ComposerWrap.svelte b/src/lib/components/refactor/ComposerWrap.svelte index 7ddcd06..7acf2d0 100644 --- a/src/lib/components/refactor/ComposerWrap.svelte +++ b/src/lib/components/refactor/ComposerWrap.svelte @@ -1,8 +1,8 @@