Javascript state machines

published Jul 08, 2013 04:25   by admin ( last modified Jul 08, 2013 04:26 )

ifandelse/machina.js · GitHub

jakesgordon/javascript-state-machine · GitHub

When you lose control of the javascript code and the code controls you, it's time to refactor. But into what? It is tempting to go with one of the MVC frameworks, with different definitions of the letters. But as I was looking at my code and thought "What is the simplest way of representing this?", it seemed to point in the direction of a state machine. Will report back with news.