Comparing version 0.1.5 to 0.1.6
{ | ||
"name": "state_lite", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"author": "Steelbreeze <mesmo@steelbreeze.net>", | ||
@@ -5,0 +5,0 @@ "description": "Lightweight state machine library for JavaScript", |
@@ -5,3 +5,3 @@ state_lite.js | ||
The current beta version is: 0.1.5. | ||
The current beta version is: 0.1.6. | ||
@@ -11,6 +11,7 @@ If you like it, please star it... | ||
#API | ||
The exported API consists of one class, one enum and one function; briefly: | ||
The exported API consists of one class, one enum and two functions; briefly: | ||
* **[State](https://github.com/steelbreeze/state_lite.js/wiki/State)** class: defines the heirarchy of states within a state machine and their entry/exit behavior. | ||
* **[History](https://github.com/steelbreeze/state_lite.js/wiki/History)** enum: used as an optional parameter to the State constructor defined either Shallow or Deep history semantics for composite states. | ||
* **[transition](https://github.com/steelbreeze/state_lite.js/wiki/transition)** function: defined the transitions between states, their guard conditions and behavior. | ||
* **[transition](https://github.com/steelbreeze/state_lite.js/wiki/transition)** function: defines the transitions between states, their guard conditions and behavior. | ||
* **[completion](https://github.com/steelbreeze/state_lite.js/wiki/completion)** function: defines completion transitions between states, their guard conditions and behavior; completion transitions are evaluated after entry to states that are deemec to be complete. | ||
@@ -17,0 +18,0 @@ Detailed documentation to follow in the project wiki... please bear with me... |
@@ -46,2 +46,4 @@ /* | ||
this.transitions = []; | ||
this.entry = []; | ||
this.exit = []; | ||
@@ -77,6 +79,4 @@ // set the parent's initial state as necessary | ||
// call the user-defined exit behaviour | ||
if (this.exit) { | ||
for (i = 0, len = this.exit.length; i < len; ++i) { | ||
this.exit[i](); | ||
} | ||
for (i = 0, len = this.exit.length; i < len; ++i) { | ||
this.exit[i](); | ||
} | ||
@@ -92,8 +92,6 @@ }; | ||
// call the user-defined entry behaviour | ||
if (this.entry) { | ||
for (i = 0, len = this.entry.length; i < len; ++i) { | ||
this.entry[i](); | ||
} | ||
for (i = 0, len = this.entry.length; i < len; ++i) { | ||
this.entry[i](); | ||
} | ||
// update the parent's current state | ||
@@ -100,0 +98,0 @@ if (this.parent) { |
Sorry, the diff of this file is not supported yet
118747
13
135
160