Hacker News new | ask | show | jobs
by jgreen10 4827 days ago
Have you tried state machines?

My JS programming often looks something like: https://gist.github.com/anonymous/5314313

I don't really care if the APIs I use have callbacks or promises, both fit in just fine.

1 comments

Nice example :) I tend to think state machines are underused, they give you wonderfully predictable behavior.