XState v6 roadmap #5061
Replies: 3 comments 9 replies
-
Tbh, XState v5 is so good, it could stay on this version forever and I'd be happy! Nonetheless, here are my wishes for a new version. Could guards somehow narrow the type of properties in the context of actions? I'd imagine this to be quite tricky, but maybe exposing another type helper on top of the existing ones ( guards: {
hasUserActor: ({ context }) => exists({userRef: context.userRef)}, // usually I'll have Boolean(context.userRef) here
}
...
{
guard: 'hasUserActor`,
actions: sendTo(({context}) => context.userRef!, // Here we always need to use the exclamation mark Would be awesome if TypeScript knew that the userRef certainly exists when the action is called. Another type related thing is full type support for |
Beta Was this translation helpful? Give feedback.
-
Couple of times I've wanted multiple guards. eg
where all would have to return true can easily make a helper to do this, but would be nice. Also feel like multi invoke + onDone could be anice addition
|
Beta Was this translation helpful? Give feedback.
-
Better server-side support please:
Points 2 and 3 have workarounds, but point 1 is currently preventing me from using XState which makes me sad. |
Beta Was this translation helpful? Give feedback.
-
This is a placeholder discussion for XState v6 ideas and future plans.
Roadmap
types
in machine configassign(…)
machine.withInput(…)
instead ofcreateActor(machine, { input })
input
is required. Current type error message is crypticBeta Was this translation helpful? Give feedback.
All reactions