game.start(param1, param2, (e) => {
axios.post(e).then(() => {
console.log("axios callback got executed"):
})
}, (b) => {
console.log("execute this after axios callback gets executed")
}
(e)
的 game.start
回调被执行多次。假设是10次。
(b)
的 game.start
回调执行的次数要少得多。假设3次。
现在,每当要执行(b)
回调时,当代码到达那里时,如果console.log
尚未完成,我不希望我的axios call
被执行。然后,整个过程一遍又一遍地重复。最佳解决方案是什么?