Skip to content

Instantly share code, notes, and snippets.

@zdychacek
Last active February 15, 2017 20:15
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 zdychacek/7359918 to your computer and use it in GitHub Desktop.
Save zdychacek/7359918 to your computer and use it in GitHub Desktop.
Q.aync and ES6 generators
Q.async(function* () {
try {
var value1 = yield step1();
var value2 = yield step2(value1);
var value3 = yield step3(value2);
var value4 = yield step4(value3);
} catch (e) {
// Handle any error from step1 through step4
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment