StateJacket JS
Based on StateJacket by hopsoft.
State Transition System for JavaScript
An IntuitiveState machines are awesome but can be pretty daunting as a system grows. Keeping states, transitions, & events straight can be tricky. StateJacket simplifies things by isolating the management of states & transitions. Events are left out, making it much easier to reason about what states exist and how they transition to other states.
The examples below are somewhat contrived, but should clearly illustrate the usage.
The Basics
Install
$ npm install state-jacket
turnstyle.
Define states & transitions for a simplevar StateJacket = ;var states = ; states;states;states;states; states; // => ['open', 'closed']states; // => ['error'] states; // => truestates; // => truestates; // => falsestates; // => false