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;
$: if (me.do) {
childStore = me.do.subscribeComposer('@ComposerBob');
childStore = me.do.core.subscribeComposer('@ComposerBob');
}
$: {

View File

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