Hacker News new | ask | show | jobs
by nailer 1134 days ago
You could also just make a very simple State machine. They don’t take a huge amount of code. you have a variable with the current state, you have a function that takes the previous state and the new State as arguments, now implement whatever logic you need. Not everything needs a library.

Pardon the unnecessary caps, I am using voice dictation.