fix buggy commit

This commit is contained in:
Samuel Andert
2023-08-03 17:15:24 +02:00
parent c9be693408
commit 472e4e33ec
3 changed files with 21 additions and 25 deletions

View File

@ -8,12 +8,11 @@
let childStore;
$: if (me.do) {
childStore = me.do.core.subscribeComposer('@ComposerBob');
childStore = me.do.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,11 @@
export let machineService;
const handleButton = () => {
console.log('BOB machine service: ' + JSON.stringify(me.do.machine));
console.log('Sending TOGGLE event to the machine');
me.do.machine.send('TOGGLE');
if (me && me.do && me.do.machine) {
console.log('BOB machine service: ' + JSON.stringify(me.do.machine));
console.log('Sending TOGGLE event to the machine');
me.do.machine.send('TOGGLE');
}
};
</script>