Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed May 19, 2017
1 parent e59ef17 commit edb9906
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Expand Up @@ -2,6 +2,30 @@
A Javascript state machine with a simple API. Well tested, and typed with Flowtype. MIT license.

## TL;DR
Specify finite state machines with a brief syntax. Run them. Derive charts from them. Save and load states. Make factories. Impress friends and loved ones. Cure corns and callouses.

```javascript
const traffic_light = new jssm.machine({

initial_state : 'Red',

transitions : [
{ action: 'Proceed', from:'Green', to:'Yellow' },
{ action: 'Proceed', from:'Yellow', to:'Red' },
{ action: 'Proceed', from:'Red', to:'Green' }
]

});

traffic_light.state(); // 'Red'
traffic_light.action('Proceed');
traffic_light.state(); // 'Yellow'
traffic_light.action('Proceed');
traffic_light.state(); // 'Green'
```

![](docs/ryg traffic light console screenshot.png)

## Quick Start
## Why
## How To
Expand Down

0 comments on commit edb9906

Please sign in to comment.