Skip to content

issue with _when() #224

@guig0

Description

@guig0

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions