From aced9fca2b8921952a021a44b324a4afc1a80bc9 Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Fri, 4 Aug 2023 18:41:58 +0200 Subject: [PATCH] refactor save --- src/lib/components/refactor/ComposerAlice.svelte | 4 ++-- src/lib/components/refactor/ComposerBob.svelte | 4 ++-- src/lib/components/refactor/ComposerCharly.svelte | 9 ++++++--- src/lib/components/refactor/ComposerWrap.svelte | 2 +- src/lib/core/refactor/Composer.svelte | 4 ++-- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/lib/components/refactor/ComposerAlice.svelte b/src/lib/components/refactor/ComposerAlice.svelte index fe1fcd7..1c7eb52 100644 --- a/src/lib/components/refactor/ComposerAlice.svelte +++ b/src/lib/components/refactor/ComposerAlice.svelte @@ -15,10 +15,10 @@ } -
+

My ID is: {me.id}

- I am the parent, this is my state: {$data.state} + My state is: {$data.state}
-
+

My ID is: {me.id}

- i am the child and this is my state: {$data.state} + My state is: {$data.state} -
-
+
+
+

My ID is: {me.id}

+ + My state is: {$data.state} {#if $data.store.todos} {#each $data.store.todos as todo}

{todo.text}

{/each} {/if}
-
+
{#if $data.store.messages} {#each $data.store.messages as message}

{message.text}

diff --git a/src/lib/components/refactor/ComposerWrap.svelte b/src/lib/components/refactor/ComposerWrap.svelte index 5b1f807..0189c82 100644 --- a/src/lib/components/refactor/ComposerWrap.svelte +++ b/src/lib/components/refactor/ComposerWrap.svelte @@ -31,7 +31,7 @@ component: 'ComposerCharly', slot: 'aside', data: { - queries: { + map: { todos: queryTodos, messages: queryMessages } diff --git a/src/lib/core/refactor/Composer.svelte b/src/lib/core/refactor/Composer.svelte index 5352a9e..18b4b3e 100644 --- a/src/lib/core/refactor/Composer.svelte +++ b/src/lib/core/refactor/Composer.svelte @@ -115,8 +115,8 @@ if (child.id) { child.store = createComposerStore(child.id, child.store || {}); - if (child.data?.queries) { - subscribeAndMapQueries(child.id, child.data.queries); + if (child.data?.map) { + subscribeAndMapQueries(child.id, child.data.map); } }