const observable = new rxjs.BehaviorSubject(0);
observable.subscribe(v => console.log(v));
rxjs
.of(1)
.pipe(rxjs.operators.delay(500))
.subscribe(v => observable.next(v));
observable.next(2);
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.5.1/rxjs.umd.js"></script>
As you can see, the observable above emits 3 values in order : 0, 2, 1.
Would it be possible to cancel (or ignore) the value "1" when the value "2" is emitted ? (Without closing the subscription)