如何在Bluebird的外部承诺中实现promise.each

时间:2016-12-06 07:44:43

标签: promise bluebird

我的结构如下

functionA()
.then(() => {
    return Promise.mapSeries(array1, function(()=>{
        return functionC()
        .then(()=>{

        })
        then(()=>{
            // expected value printed here for each item item1 and item2 of array1 
        })
    })
})
.then(() => {
    // Part B - Complete for all array elements
    // But unexpected result - array1 second item overlapped with array1 first item
})

在PartB中,我期望array1中第1和第2项的值组合,但是出现了意想不到的组合,其中item2结果与item1结果重叠。代码哪里出错?

0 个答案:

没有答案
相关问题