Problem:
Currently, the actions in the tournament context, as well as the behavior of the components, depend on the current phase of the tournament. During development, it’s common for an action to incorrectly alter the phase, causing the tournament to behave undesirably and extending the development process as developers try to figure out how the bug occurred and how to fix it.
Proposed solution:
Use a state machine to control the phase changes of the tournament.
Problem: Currently, the actions in the tournament context, as well as the behavior of the components, depend on the current phase of the tournament. During development, it’s common for an action to incorrectly alter the phase, causing the tournament to behave undesirably and extending the development process as developers try to figure out how the bug occurred and how to fix it.
Proposed solution: Use a state machine to control the phase changes of the tournament.
Alternatives XState