added stateMachine to stateMachine communication

This commit is contained in:
Samuel Andert
2023-08-02 11:49:05 +02:00
parent 48903fbe7d
commit 7f57036e94
6 changed files with 147 additions and 9 deletions

View File

@ -5,6 +5,31 @@
export let machine;
let composite = {
id: 'testingstuff',
layout: {
columns: '1fr 1fr',
areas: `
"left right"
`
},
children: [
{
id: 'child',
component: 'LearnReady',
slot: 'left',
store: {
xstate: 'NOTREADY'
}
},
{
id: 'parent',
component: 'LearnColor',
slot: 'right'
}
]
};
let current = machine.initialState.value;
const service = interpret(machine)
@ -19,6 +44,9 @@
<main class="grid w-full h-full grid-rows-layout">
<div class="w-full h-full p-4 overflow-scroll">
<div class="h-1/4">
<Composite {composite} />
</div>
<p>Current state: {current}</p>
<h1>{machine.states[current].meta.title}</h1>
{#if machine.states[current].meta.composite}