I'm trying to figure out how to get the value of a promise via yield
, possibly with "co":
function *(){
var someVar = yield functionThatReturnsAPromise();
}
The called function is not a generator, just a normal function. With the above, someVar == Promise
, but I want the resolved value. Does co or some other library have a way of doing this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…