我是新來的承諾,和我讀一段代碼,這是非常困難的,我明白了:JavaScript和承諾:如何重構/拼合下面的嵌套承諾?
return promise
.then(function helper0(instances) {
return helper1(instances, options)
.then(function helper2() {
return bluebird.delay(3000)
.then(function helper3() {
return helper4(localParams, options);
});
}
});
});
如何重新因素它promise.then().then()...
?由於
謝謝,你有任何建議爲https://stackoverflow.com/questions/45292024/mocha-sinon-unit-tests-for-chained-promise? – BAE