Skip to content

Commit

Permalink
Fix example code in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiezane committed Nov 5, 2015
1 parent 6450f14 commit d0f633d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ var vehicleSignal = new machina.Fsm( {
this.timer = setTimeout( function() {
this.handle( "timeout" );
}.bind( this ), 30000 );
this.emit( "vehicles", { status: GREEN } );
this.emit( "vehicles", { status: "GREEN" } );
},
// If all you need to do is transition to a new state
// inside an input handler, you can provide the string
Expand All @@ -109,7 +109,7 @@ var vehicleSignal = new machina.Fsm( {
}.bind( this ), 5000 );
// machina FSMs are event emitters. Here we're
// emitting a custom event and data, etc.
this.emit( "vehicles", { status: YELLOW } );
this.emit( "vehicles", { status: "YELLOW" } );
},
timeout: "red",
_onExit: function() {
Expand All @@ -121,14 +121,14 @@ var vehicleSignal = new machina.Fsm( {
this.timer = setTimeout( function() {
this.handle( "timeout" );
}.bind( this ), 1000 );
this.emit( "vehicles", { status: RED } );
this.emit( "vehicles", { status: "RED" } );
},
_reset: "green",
_onExit: function() {
clearTimeout(this.timer);
}
}
}
},

// While you can call the FSM's `handle` method externally, it doesn't
// make for a terribly expressive API. As a general rule, you wrap calls
Expand Down

0 comments on commit d0f633d

Please sign in to comment.