added loading and passing of svelte state stores to the machine context
This commit is contained in:
@ -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'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user