4
序列化一串承诺的函数调用最方便的方法是什么?序列化js承诺列表调用
var promised_functions = [
fn1, // call this
fn2, // if previous resolved call this
fn3 // if previous resolved call this
];
q.serialize_functions(promised_functions)
.then(function(){
// if all promises resolved do some
})
看看这个问题。我可能会找到你的答案:http://stackoverflow.com/questions/18386753/how-to-sequentially-run-promises-with-q-in-javascript – peernohell