Refactoring composite interface part1

This commit is contained in:
Samuel Andert
2023-08-03 14:03:02 +02:00
parent 37b915cef6
commit dcb94e7c58
8 changed files with 399 additions and 180 deletions

View File

@ -0,0 +1,18 @@
<script>
export let store;
export let machineService;
const handleButton = () => {
console.log('learn ready machine: ' + JSON.stringify(machineService));
console.log('Sending TOGGLE event to the machine');
machineService.send('TOGGLE');
};
</script>
<div class="border-2 border-yellow-500">
i am the child and this is my state: {$store.machine.state}
<button
class="px-4 py-2 font-bold text-white bg-blue-500 rounded hover:bg-blue-700"
on:click={handleButton}>Switch</button
>
</div>