At one end, I have a thread that can sometimes cause an error:
this.behaviorSubject.error(error)
Later, however, I want to continue the flow:
this.behaviorSubject.next(anotherValue)
on the other end, I have a subscriber subscribed to behaviorSubject.asObservable().
In the subscription, I handle the value and the error:
.subscribe(
( value ) => { },
( error ) => { }
);
I want the effect to be the same as a simple callback onSuccessand onErrorwhere it onErroris called every time an error occurs and does not interfere with future calls onSuccess. How to do it with RXJS?
I was looking for a trick, but it looks like it just prevents calling callers.
David source
share