MHN
Add a comment on Hacker News →
1 comment
  1. I would use a state machine in this case. The best tool for doing this in JavaScript/TypeScript is XState. Highly recommend.