30 lines
583 B
Svelte
30 lines
583 B
Svelte
<script>
|
|
export let me;
|
|
export let services;
|
|
export let store;
|
|
|
|
export let machineService;
|
|
|
|
let childStore;
|
|
|
|
$: if (me.do) {
|
|
childStore = me.do.subscribeComposer('@ComposerBob');
|
|
}
|
|
|
|
$: {
|
|
if ($childStore && $childStore.machine.state) {
|
|
me.do.machine.send($childStore.machine.state);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<div class="p-2 border-2 border-blue-500">
|
|
<p>My ID is: {me.id}</p>
|
|
|
|
I am the parent, this is my state: {$store.machine.state}
|
|
<div
|
|
class="p-2 border-2"
|
|
style="background-color: {$store.machine.state}; border-radius: 50%; width: 50px; height: 50px;"
|
|
/>
|
|
</div>
|