News for hackers. Stuff that matters.
Re:useStateMachine: A ½ kb state machine hook for React by fuzzy2 on Saturday May 22, 2021 @09:36AM (#27246381)
I think your problem is that many things don’t have to be a state machine. And you’re right. It’s simply not a good idea to create a confirmation dialog like that.

However, some things just _are_ state machines. You don’t usually see them in the GUI (except for example wizards), but many parsers can trivially be implemented with state machines.

Re:useStateMachine: A ½ kb state machine hook for React by matsemann on Saturday May 22, 2021 @12:00PM (#27247751)
I actually believe there would be fewer UI bugs if more UI was modeled as a state machine. After all, all diagrams and design is often based on "when X is shown and Y is pressed, we go to Z". But in code that's expressed in a way that makes it possible to have a mismatch between multiple half baked states.