Finite State Machine Playground

The neighbourhood head carries one lantern between four places on the lane, idle, loading, success, error, and walks only the roads on his map; with three…

Why it matters

Spinners that never go away, flickering errors, “loading AND success at once”: all from tangled booleans. An FSM makes impossible states impossible. It is also exactly the useReducer pattern (state + dispatch).

The key idea

One active state makes impossible states impossible

Common mistakes

Try it in this playground