Skip to content

How to use it with a library of functions

shimondoodkin edited this page Nov 10, 2010 · 1 revision

We usually call function from a library object, for example in a website we have several pages (objects). pages can share functions between them. for example:

user.js: this.checklogin=function(){ ... this(); }

this.load_userdata=function(arg1){
 ... 
 this();
}

app.js: var app={}; app.user=require('user'); var shared={ app:app } inflow.flow(shared, [ app.user.checklogin, [app.user.load_userdata,['value to arg1']], app.common.rander ]); // see Full example later in the page

this way you can have functions inside other files easily without closure