Polling() {
const setTimer = () => {
this.timer && clearTimeout(this.timer);
this.$store
.dispatch('fetchPatient', {
consult_id: localStorage.getItem('consult_id'),
})
.finally(() => {
this.timer = setTimeout(() => {
setTimer();
}, 3000);
});
};
this.timer = setTimeout(() => {
setTimer();
}, 3000);
},
beforeDestroy() {
clearTimeout(this.timer);
},
接口轮询最优解
最新推荐文章于 2023-08-16 15:18:40 发布