How to keep observable alive after error in RxJS 6 and Angular 6
问题 Can anyone help with the scenario where this._getReactions$.next() not working whenever this.http.get(...) gets an error. I want to keep observable alive to take the next input. private _getReactions$: Subject<any> = new Subject(); constructor() { this._getReactions$ .pipe( switchMap(() => { return this.http.get(...) // http request }), catchError(error => { console.log(error); return empty(); }) ) .subscribe(data => { console.log(data) //results handling }); } onClick() { this._getReactions$