mapped all services to our new me.do. prop

This commit is contained in:
Samuel Andert
2023-08-03 16:47:26 +02:00
parent 55b701a859
commit c9be693408
3 changed files with 24 additions and 18 deletions

View File

@ -8,11 +8,12 @@
let childStore;
$: if (me.do) {
childStore = me.do.subscribeComposer('@ComposerBob');
childStore = me.do.core.subscribeComposer('@ComposerBob');
}
$: {
if ($childStore && $childStore.machine.state) {
console.log('ALICE machine service: ' + JSON.stringify(me.do.machine));
me.do.machine.send($childStore.machine.state);
}
}

View File

@ -4,9 +4,9 @@
export let machineService;
const handleButton = () => {
console.log('learn ready machine: ' + JSON.stringify(machineService));
console.log('BOB machine service: ' + JSON.stringify(me.do.machine));
console.log('Sending TOGGLE event to the machine');
machineService.send('TOGGLE');
me.do.machine.send('TOGGLE');
};
</script>