In my angular app i would like to be able to cancel and http request that is make with Rxjs. The scenario:
isComponentAlive = true;
onSave() {
this.service.save(this.formValue).takeWhile(() => this.isComponentAlive).subscribe();
}
ngOnDestroy() {
this.isComponentAlive = false;
}
Than i have a cancel button which navigates to another route. I would like to cancel a pending http request, but this way is not working. I would like to do something more clear then calling unsubscribe to all my http request subscriptions