State Machines

This lesson talks about state machines, a concept closely related to discriminated unions.

Introduction to state machines

Managing the state is one of the hardest parts of frontend development. Many frameworks and libraries have been created to help with this task. One of the proposed approaches is to utilize state machines. A state machine is a directed graph where nodes represent all possible states of a view or of the whole app, and where edges represent possible transitions between the states.

An arrow between two nodes means that it’s possible to go through one state to another via some action. All non-listed transitions are not possible. There can be a meaningful transition from a state to the ...