【发布时间】:2021-07-04 06:22:39
【问题描述】:
一旦单击按钮,我发现很难使用 Rxjs 对 HTTP 请求实现去抖动。我想要实现的是,当单击按钮时,它应该等待 x 秒,然后才能将帖子发送到服务器。
btnClick() {
this.loader = true;
let send = "";
send = this.checkForm.username.value;
this.checkService
.validate(send)
.pipe(finalize(() => (this.loader = false)))
.subscribe((response) => {
console.log(response)
});
}
【问题讨论】: