0

So here's the issue. For starters I have many jQuery promises (defined with $.ajax) and I need to act upon the values returned by parsing the data and making another block of promises.

For example my code would look like this:

Q.all(promisesArray).spead(function(){
 let responses = Array.prototype.slice.call(arguments);
 .......  parse the data and get a result array which I need to use to make more promises

    What do I do here?
      Q.all(otherPromisesArray).spread(function(){....})   does not work
 });
MayTheSchwartzBeWithYou
  • 1,181
  • 1
  • 16
  • 32

1 Answers1

0

I found the solution here on "Chaining"

https://github.com/kriskowal/q

let higherScopeResult = []
Q.all(promisesArray).then(function(){
    let responses = Array.prototype.slice.call(arguments)[0];
    ..... do things ......
    return Q.all(otherPromisesArray).then(function(){....});
 });
MayTheSchwartzBeWithYou
  • 1,181
  • 1
  • 16
  • 32