Stepx
Steps manager for JavaScript.
Example
var fs = path = Stepx = content = ''; //Create a Steps Managervar stepx = { console; } { console; }; //Add Named Step (id: read_file)stepx; //Add Named Step (id: second_step)stepx; //Add Named Step (id: never_will)stepx; //Add Named Step (id: print_content)stepx; //Starts the Steps Executionstepxstart;
Methods
add(fn [, id])
- Add a function to the Manager;
next()
- Run the next step;
goto(index)
- Go to the step at the index (number/id) and run;
start()
- Starts the execution of the steps;
- Fire
onStart
event;
finish()
- Ends the execution of the steps;
- Fire
onFinish
event; - The method
next()
on last step fires onFinish event too;