Skip to content

Instantly share code, notes, and snippets.

@juandopazo
Created June 25, 2011 21:21
Show Gist options
  • Select an option

  • Save juandopazo/1046912 to your computer and use it in GitHub Desktop.

Select an option

Save juandopazo/1046912 to your computer and use it in GitHub Desktop.
Y.when with end()
// In this case async3() won't be executed instantly but rather after async1 and async2 are completed
Y.when(async1(), async2()).then(async3()).end(function () {
console.log('success');
}, function () {
console.log('failure');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment