I have an Angular application (9) and have multiple components that request calculation operations over rest and the displays the result in different editors. Now before I make the request I call a loading panel and after the request fininished I hide the loading panel in the finalize callback. Something like this:
this.isloading = false;
httpclient.get('http://localhost/calculate').pipe(finalize(() =>this.isloading=false).subscribe(v=>{
//make some operations with the data and set editor values
});
now the loading panel disappers before all editor values are set. The finalize callback is called directly if the request fininishes, but how to call something like finalize, if the code inside of subscribe or error finishes?