I have this code and having a hard time figuring out what to do, wherein the UI there is a save button and an interval saving. if the interval saving is in progress then the user hits the save button, the same request on the button should deny this request. for now, in my code, I subscribe on this BehaviourSubject variable to see it there in progress then execute request if false.
is there any mechanism or another best approach for this rather than flagging? because I face an issue, what if the interval saving and saving button is triggered and same second/moment/time?
Observable.interval(180000).subscribe((data) => {
if (!this.saveService.getSavingProgress()) {
this.saveService.autoSave().subscribe((status) => {
}
}