ayttm JavaScript framework for coding UI with state machines. See http://nicopolyptic.github.io/2014/02/20/javascript-state-machines.html for examples.