Demo:  race

The race takes the values from the observable that emits first and cancels the other observables.

It can be very useful for critical applications with faster response time needs.

let input_1 = timer(500,2000).pipe(map(v=>v+10), take(4)) ;

//Around 50% of time input_2 should emit before input_1
let input_2 = iif( () => (Math.random() > 0.5) ,
              timer(0,2000) , timer(1000, 2000)).pipe(take(3));

//Take the output from the one that emits first
let combinedInput = race(input_1 , input_2);

let output = combinedInput.subscribe(v=>console.log(v))