Defining a transition
To add a transition between states:
- Click on the edge of the source state and drag the mouse towards the target state and then release the mouse.
- Coder will ask you to provide an event the transition will correspond to. You can leave it blank if you want, like in our example.
Create states and transitions with template proposals
Create states and transitions faster using template proposals. While focused on the Flux service's canvas in the editor, press . This should trigger Coder's content assist.
To create a new state, select the state's action first (use and keys to shift choices), press to finalize your selection, enter the name of the state in the appearing dialog, and then press once more. You should now have a new state in your canvas.
Template proposals usually require some additional input like naming a field or selecting another proposal or property, which is why you were prompted to provide the necessary fields through dialogs.