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(...)
}