Here is a simple state machine that includes a few of the concepts.
From this drawing, we can see that
- This machine has two states{:.glossary}, On and Off
- it transitions{:.glossary} between them whenever it gets the flick event{:.glossary} (that's the two arrows between the states)
- The "on" state has some actions{:.glossary} that happens when it enters or exits that state.
The machine basically functions as an on-off switch which turns a light on or off whenever it gets the "flick" event
- A more advanced on-off switch — adds more features to this simple switch logic