Skip to content

"this" of a called function

shimondoodkin edited this page Nov 10, 2010 · 1 revision
function part(argument1,...)
{
 this.next(return_value); // a function to call at the end of the part;
 this.shared // a shared object between all the calls in a flow
 
 //and also:
 this.shared.lib // idea how to do dependency injection (a shared object that holds all the libraries)
 this.shared.app // also you can give access to other global shared objects
 
 this.steps;  // array of all function (it is possible to push to it a new next step)
 
 this.flow; // inflow.flow shortcut
 this.each; // inflow.each shortcut
 this.parallel; // inflow.parallel shortcut
 this.while; // inflow.each shortcut
 
 this.args //arguments of previously called next(arg1,arg2) function in sequential flow
 this.results //arguments of all called next(arg1,arg2) functions in parallel
 
 this.key   //availible in "this" of for_each_function, in inflow.each
 this.value //
 this.items //
 
 return this.continue() //availible in "this" of a while_function, in inflow.while, this.continue=this.next
 return this.break()    //availible in "this" of a while_function, in inflow.while, call the callback and finish the loop.
 
 //also you can do:
 this(); or this.next(); //those are the same.
};
Clone this wiki locally