javascript promise not passing all arguments (using Q)

后端 未结 3 1655
半阙折子戏
半阙折子戏 2020-11-29 11:15

I am having trouble passing all arguments. My promise callback only receives one instead of three:

var asyncFunction= function(resolve) {
    setTimeout(func         


        
3条回答
  •  不知归路
    2020-11-29 11:43

    Q promises can be resolved with only one argument - a promise stands for one single value, not for a collection of them. Put them in an array explicitly if you need multiple values. For the multiple-parameter-callbacks, you can use .spread().

提交回复
热议问题