Answer the question
In order to leave comments, you need to log in
RxJS - How to get subscriber only new values?
Hello.
How to make sure that the subscriber does not receive old values, but only expects new ones (in my case, one).
const sbj = new ??Subject<number>();
sbj.next(2);
// Не будет обработан подписчиками
sbj.subscribe(vl => console.log(`1st: ${vl}`));
sbj.subscribe(vl => console.log(`2nd: ${vl}`));
sbj.next(7);
// 1st: 7
// 2nd: 7
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question