Is there a way to count "steps to final state" / states programatically? #3705
Unanswered
radiodario
asked this question in
General
Replies: 2 comments 1 reply
-
There is no builtin way of doing a thing like this. However, XState config is just a JavaScript object - you can just process it however you want and count accordingly to your use case. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Can you share an example machine? You can probably use |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using XState for a relatively complex - branching form (signup) and one of the requirements from the UX team is to have some sort of "progress" bar to indicate how far through the signup process you are (and how much is left)
As a dev, i want to not have to maintain this (so no hard-coding) as different steps are added and logic changes. I want to do this programatically.
Is there a way to count how many steps away from a "final" state we are, in order to turn this into a progress display that updates as you proceed through the machine's states?
Beta Was this translation helpful? Give feedback.
All reactions