You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • Just looked at this, and:

    var promise = new Promise( function(resolve,reject) { resolve(); } );
    Promise.all( [promise] ).then( function() { print( "never called :-(" ); } )
    

    Does work. My guess is the reason you're having problems is you're doing this at the root scope - effectively pasting in one command after the other. In that case, var promise = new Promise( function(resolve,reject) { resolve(); } ); gets called first, and executes on its own. There's nothing linked to it so it just completes and everything is ok.

    Then, when you do Promise.all, it's already been resolved so nothing happens. If you just wrap the two commands in curly braces or execute them in a function, everything's fine. I'll try and add something to cope with that eventuality.

    As for the other bit, at the moment Promise.all doesn't return things in order - just in the order they complete. I'll try and fix that one too.

About

Avatar for Gordon @Gordon started