Skip to content

Instantly share code, notes, and snippets.

umar-muneer / faulty-component.ts
Created Aug 12, 2021
Keep the Observable alive after error
View faulty-component.ts
public class Component {
constructor(private service: Service) {}
handleClick$ = new Subject();
ngOnInit() {
switchMap(() => {
return this.service.someObservable$;
// this observable would stop firing as soon as there is an error, subsequent button clicks will not trigger it.