Skip to content

Forbidden transition resets visualization to initial state #50

@davidlav

Description

@davidlav

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions