Last active
August 29, 2015 14:01
-
-
Save rmetzler/cae82f1a8d1b81aab34c to your computer and use it in GitHub Desktop.
Mixing parallel and sequential promises
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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