我试图消除动作中的任何东西,它会以这样或那样的方式被吞没...
以以下(伪)代码为例:
import { debounce } from "lodash";
const actions = {
debounceSomeLogging ({ dispatch }, text) {
console.log("Outside debounced function.");
debounce(function() {
console.log("Inside debounced function.");
dispatch("doRealThing");
}, 1000);
},
doRealThing({ commit }) {
// Whatever
}
}
当我调用该操作时,我看到了Outside debounced function
,但我看不到另一个日志(log)记录,并且另一个操作没有被触发.
有没有人有这方面的经验,能为我指出正确的方向?