Is there a way to stop execution of next function of series with async in nodejs?

前端 未结 4 1016
深忆病人
深忆病人 2021-02-14 06:13
  async.map(list, function(object, callback) {
    async.series([
      function(callback) {
        console.log(\"1\");

        var booltest = false;
        // assumi         


        
4条回答
  •  死守一世寂寞
    2021-02-14 07:10

    The flow will stop if you callback with true as your error argument, so basically

    if (booltest)
         callback(null, 'one');
    else
         callback(true);
    

    Should work

提交回复
热议问题