Angular : how to call finally() with RXJS 6 : <p>I was using RXJS 5, now as I upgraded it to 6, I am facing some problems.</p>

<p>Previously I was able to use catch and finally but as per update catch is replaced with catchError (with in the pipe) now how to use finally?</p>

<p>Also I have some questions :</p>

<p>Do I need to change throw->throwError (in below code Observable.throw(err);)</p>

<pre><code>import { Observable, Subject, EMPTY, throwError } from "rxjs";
import { catchError } from 'rxjs/operators';

return next.handle(clonedreq).pipe(
          catchError((err: HttpErrorResponse) =&gt; {
        if ((err.status == 400) || (err.status == 401)) {
            this.interceptorRedirectService.getInterceptedSource().next(err.status);
            return Observable.empty();
        } else {
            return Observable.throw(err);
        }
       }) 
        //, finally(() =&gt; {
        //  this.globalEventsManager.showLoader.emit(false);
        //});
      );
</code></pre>

<p>Also how to use publish().refCount() now ?</p>
