Answer the question
In order to leave comments, you need to log in
How to unsubscribe?
There is a function like this
const sub: Subscription = this.usersService.allUsers
.subscribe(users=> {
otherBehaviorSubject.next(users.filter(/*some filter function*/));
sub.unsubscribe(); // В этом моменте постоянно матерится на то что sub === undefined
});
Answer the question
In order to leave comments, you need to log in
Coder321 at least sub.unsubscribe(); put out of brackets
const sub: Subscription = this.usersService.allUsers
.subscribe(users=> {
otherBehaviorSubject.next(users.filter(/*some filter function*/));
});
sub.unsubscribe();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question