Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmetzler/cae82f1a8d1b81aab34c to your computer and use it in GitHub Desktop.
Save rmetzler/cae82f1a8d1b81aab34c to your computer and use it in GitHub Desktop.
Mixing parallel and sequential promises
var p1 = $.get('https://google.com/').then(function(){
console.log('p1a done');
return $.get('https://google.com/').done(function(){
console.log('p1b done');
});
}).done(function(){
console.log('p1 done');
});
var p2 = $.get('https://google.com/').done(
function(){console.log('p2 done');}
);
$.when(p1,p2).done(function(){
console.log('all done');
});
console.log('start');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment