Created
October 16, 2016 23:07
-
-
Save diorahman/789db19a53016e4bfcdb7580e6a9d877 to your computer and use it in GitHub Desktop.
__async
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
function __async(g) { | |
return new Promise(function(s, j) { | |
function c(a, x) { | |
try { | |
var r = g[x ? "throw" : "next"](a) | |
} catch (e) { | |
j(e); | |
return | |
} | |
r.done ? s(r.value) : Promise.resolve(r.value).then(c, d) | |
} | |
function d(e) { | |
c(e, 1) | |
} | |
c() | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment