Last active
February 15, 2017 20:15
-
-
Save zdychacek/7359918 to your computer and use it in GitHub Desktop.
Q.aync and ES6 generators
This file contains hidden or 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
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