How do I fire an event that performs an async
call and assign
s the result to the context
#4683
Unanswered
escritorio-gustavo
asked this question in
Q&A
Replies: 2 comments 9 replies
-
You can return data that you want to assign to context from your async job and use that to invoke: {
src: 'asyncJobThatReturnsTheData',
onDone: { actions: assign(({ event }) => event.output) }
} A more complete example can be found here |
Beta Was this translation helpful? Give feedback.
9 replies
-
Now that v5 for solid is out, what would be the "proper" way to achieve this? I want the
on: {
setPage: {
actions: assign({
pageIndex: ({ event }) => event.pageIndex,
page: ({ event }) => /* fetch data at event.pageIndex */
}),
},
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm creating a Tauri app using SolidJS and xstate. I want to read from a file with the following work flow:
1- click button
2- call tauri apis to read file
3-
await
file read operation4-
assign
the resultI have done this in the past through some dodgy code, and I want to know whats the proper way to do this with xstate
Beta Was this translation helpful? Give feedback.
All reactions