Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbidden transition resets visualization to initial state #50

Open
davidlav opened this issue Feb 4, 2020 · 0 comments
Open

Forbidden transition resets visualization to initial state #50

davidlav opened this issue Feb 4, 2020 · 0 comments

Comments

@davidlav
Copy link

davidlav commented Feb 4, 2020

The machine below requires moving through states stepOne and stepTwo, in addition to requiring an approval. The approved context property ought to be able to be set at any state (i.e. start, stepOne, stepTwo, or awaitingApproval) as it is independent of what "stage" you're at. It is, however, a necessary condition for reaching success.

This implementation (credit to @semopz) shows the machine acting properly as described above:

https://codesandbox.io/s/zealous-sun-vt05g

However, clicking APPROVAL_GIVEN while in the states stepOne, stepTwo, or awaitingApproval in the Visualizer (below) will erroneously reset the state to start.

https://xstate.js.org/viz/?gist=e59bcb81a7d79dadd2b1d06a1f9e55ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant