A problem about Recursion

The

function goes like this

const handleAddInfo = () => {
    // 
    this.props
      .dispatch({
        type: "video/setAlarmRuleEditMode",
        payload: alarmRuleEditMode.add,
      })
      .then(() => {
        this.props.dispatch({
          type: "video/setBlackListData",
          payload: {
            key: null,
          },
        });
      })
      .then(() => {
        this.props.dispatch({
          type: "video/setNaviKey",
          payload: {
            key: "addBlackList",
          },
        });
      });
  };

I want to write it as dynamic, forget to pass a few parameters automatically with several. Then, I feel that I need to use the idea of recursion, but my own idea of recursion is relatively weak. I don"t know how to write it next. I would like to ask the master to help me with some tips. Thank you very much.

    function fn(...arg) {
        arg.forEach(...)
    }
Dec.31,2021

pass any number of parameters at once

function serial (...args) {
  function runTask () {
    const arg = args.shift()
    return this.props.dispatch(arg).then(() => {
      if (args.length > 0) {
        return runTask()
      }
    })
  }
  return runTask()
}

serial(
  {
    type: 'video/setAlarmRuleEditMode',
    payload: alarmRuleEditMode.add,
  },
  {
    type: 'video/setBlackListData',
    payload: {
      key: null,
    },
  },
  {
    type: 'video/setNaviKey',
    payload: {
      key: 'addBlackList',
    },
  }
).then(() => {
    console.log('done')
})
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e455c7-43aa3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e455c7-43aa3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?