From 4a01649087b38fb3a911dc356cf2a1fd44a39438 Mon Sep 17 00:00:00 2001 From: Samuel Andert Date: Fri, 4 Aug 2023 11:12:24 +0200 Subject: [PATCH] Refactoring next part --- src/lib/components/Messages.svelte | 1 - .../components/refactor/ComposerAlice.svelte | 17 +++++++-------- .../components/refactor/ComposerBob.svelte | 7 ++----- .../components/refactor/ComposerWrap.svelte | 5 ++++- src/lib/core/refactor/Composer.svelte | 21 ++++++++++--------- src/lib/core/refactor/coreServices.ts | 4 ++-- 6 files changed, 26 insertions(+), 29 deletions(-) diff --git a/src/lib/components/Messages.svelte b/src/lib/components/Messages.svelte index 82c8714..81d3485 100644 --- a/src/lib/components/Messages.svelte +++ b/src/lib/components/Messages.svelte @@ -1,7 +1,6 @@ @@ -21,9 +18,9 @@

My ID is: {me.id}

- I am the parent, this is my state: {$store.machine.state} + I am the parent, this is my state: {$data.state}
diff --git a/src/lib/components/refactor/ComposerBob.svelte b/src/lib/components/refactor/ComposerBob.svelte index da858ec..615876c 100644 --- a/src/lib/components/refactor/ComposerBob.svelte +++ b/src/lib/components/refactor/ComposerBob.svelte @@ -1,12 +1,9 @@
{#await loadComponentAndService(composer) then Component} @@ -135,14 +136,14 @@ {#if composer?.children} {#each composer.children as child (child.id)}
{#await loadComponentAndService(child) then ChildComponent} diff --git a/src/lib/core/refactor/coreServices.ts b/src/lib/core/refactor/coreServices.ts index 532725d..af48b22 100644 --- a/src/lib/core/refactor/coreServices.ts +++ b/src/lib/core/refactor/coreServices.ts @@ -2,7 +2,7 @@ import { getComposerStore } from './composerStores'; export const coreServices = { - updateComposer: (mappings: Record) => { + mutateData: (mappings: Record) => { for (const [mappingString, value] of Object.entries(mappings)) { const [storeID, key] = mappingString.replace('@', '').split(':'); const store = getComposerStore(storeID); @@ -12,7 +12,7 @@ export const coreServices = { }); } }, - subscribeComposer: (mappingString: string) => { + subscribeData: (mappingString: string) => { const [storeID] = mappingString.replace('@', '').split(':'); const store = getComposerStore(storeID); return store;