
用
.then()
let doStuff = (resolve, reject) => {};let promise = new Promise(doStuff);doSomethingUntilPromiseisDone( promise .then(value => fetchValue(url)) .then(value => value.blob()) .then(saveToCache)).then(success => console.log("success!!")).catch(err => console.error(err))欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)