added loading and passing of svelte state stores to the machine context

This commit is contained in:
Samuel Andert
2023-08-04 14:11:55 +02:00
parent 2e4e4bdf59
commit 481cc8cf68
3 changed files with 22 additions and 25 deletions

View File

@ -1,8 +1,8 @@
<script lang="ts">
import Composer from '$lib/core/refactor/Composer.svelte';
import { assign } from 'xstate';
import { coreServices } from '$lib/core/refactor/coreServices';
import { queryMessages } from '$lib/data/queryMessages';
import { get } from 'svelte/store';
let composer = {
id: 'ComposerParent',
@ -39,12 +39,12 @@
},
states: {
LOADING: {
entry: assign({
messages: (context, event) => get(queryMessages)
}),
on: {
TOGGLE: {
target: 'READY',
actions: assign({
hello: (context, event) => 'this was updated from loading'
})
target: 'READY'
}
}
},