Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with _when() #224

Open
guig0 opened this issue Sep 10, 2014 · 0 comments
Open

issue with _when() #224

guig0 opened this issue Sep 10, 2014 · 0 comments

Comments

@guig0
Copy link

guig0 commented Sep 10, 2014

Hello,

I am having some issue with the _when function.
Here is my code :

var myGoogleSpreadsheet = ;// some google spreadsheet url
var ds = [];
var nbTab = 2;
for (j=0;j<nbTab;j++){
    ds[j]=loadDS(myGoogleSpreadsheet ,j+1);
}
var str="";
for (j=1;j<nbTab;j++){
    str += "ds["+(j-1)+"].fetch()";
    if (j<nbTab-1){str+=",";}
}

_.when(eval(str)).then(function() {
log("eval ds0:"+ds[0].columnNames()+"ds1:"+ds[1].columnNames());
});
_.when(ds[0].fetch()).then(function() {
log("not eval"+ds[0].columnNames());
});

The first _when() doesn't return a result at each time.

While if I change the code too :

_.when(ds[0].fetch()).then(function() {
log("not eval"+ds[0].columnNames());
});
_.when(eval(str)).then(function() {
log("eval ds0:"+ds[0].columnNames()+"ds1:"+ds[1].columnNames());
});

I always seem to have a result. Am I missing something here ?

Kind regards
guillaume

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant