I am new in RXJS and i want to implement debounce time when click on button. This is my button:
<button mat-mini-fab (click)="send()" [disabled]="!message.text || message.text.length === 0 || room.length === 0 || !room">
<mat-icon>send</mat-icon>
</button>
And this is my method for send:
public send(): void {
this.message = { ...this.message, room: this.room, sender: this.currentUser, createdAt: new Date() };
this.sendMessage.emit(this.message);
this.clearMessage();
}
How can i implement this, any suggestion?