Skip to content

Instantly share code, notes, and snippets.

@yashprit
Created June 23, 2014 15:33
Show Gist options
  • Save yashprit/f4685d1037365b96f82c to your computer and use it in GitHub Desktop.
Save yashprit/f4685d1037365b96f82c to your computer and use it in GitHub Desktop.
function foo(){
return Promise.all(["http://jsonplaceholder.typicode.com/posts/1", "http://jsonplaceholder.typicode.com/comments/1"]);
}
function task2(e){
alert("In two got " + e);
return " Two ";
}
function task3(e){
alert("In three got " + e);
return " Three ";
}
var p = foo();
p.then(task2);
p.then(task3);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment