Steps
Installation
Steps can be used either in a Node.js environment or in a browser, to install for Node.js use the npm package manager:
npm install promise-tiny
Usage
/** * Initial flag = 'Begin' */ { } /** * When flag === 'End', * next : function(args : Array = []) || function(args : Array, env : Object) * * Otherwise, * next : function(flag : String, args : Array = []) */
Example
var Steps = ; { this_step = 0; } { return this_step; } { this_step = n; } ;
Result
Steps: 5 trace: Begin->check->create->error->End
Count: 4 trace: new Steps()->Begin->info->logout->End !Count
License
MIT © May xiaoya zhang