abtracted generic services interface and mapping

This commit is contained in:
Samuel Andert 2023-08-03 17:34:53 +02:00
parent 472e4e33ec
commit c0d29e784a
2 changed files with 3 additions and 11 deletions

View File

@ -8,7 +8,7 @@
let childStore; let childStore;
$: if (me.do) { $: if (me.do) {
childStore = me.do.subscribeComposer('@ComposerBob'); childStore = me.do.core.subscribeComposer('@ComposerBob');
} }
$: { $: {

View File

@ -12,7 +12,7 @@
columns?: string; columns?: string;
rows?: string; rows?: string;
gap?: string; gap?: string;
tailwindClasses?: string; style?: string;
} }
interface IComposer { interface IComposer {
@ -24,13 +24,9 @@
store?: Record<string, any>; store?: Record<string, any>;
children?: IComposer[]; children?: IComposer[];
machine?: any; machine?: any;
machineService?: any;
} }
export let composer: IComposer; export let composer: IComposer;
let loadedServices: Record<string, any> = {
core: coreServices
};
let layoutStyle = ''; let layoutStyle = '';
let machineService; let machineService;
@ -115,7 +111,7 @@
component.me = { component.me = {
id: component.id, id: component.id,
do: { do: {
...loadedServices.core, core: coreServices,
machine: component.machineService || null machine: component.machineService || null
} }
}; };
@ -133,8 +129,6 @@
id={composer.id} id={composer.id}
store={getComposerStore(composer.id)} store={getComposerStore(composer.id)}
machine={composer.machine} machine={composer.machine}
services={loadedServices}
machineService={child.machineService}
me={composer.me} me={composer.me}
/> />
{/await} {/await}
@ -150,8 +144,6 @@
id={child.id} id={child.id}
store={getComposerStore(child.id)} store={getComposerStore(child.id)}
machine={child.machine} machine={child.machine}
services={loadedServices}
machineService={child.machineService}
me={child.me} me={child.me}
/> />
{#if child.children && child.children.length} {#if child.children && child.children.length}