Demo: raceWith
Similar to race , raceWith takes the emitted values from the observable that emits first and cancels the other one.
//Around 50% of time input_1 will start immediately
let input_1 = iif( ()=>(Math.random() > 0.5),
timer(0,2000) , timer(1000, 2000))
.pipe(take(3)) ;
//raceWith an observable that starts at 0.5 sec.
let process = raceWith( timer(500,2000)
.pipe(map(v=> v+10), take(3)));
let output = input_1.pipe(process).subscribe(v=>console.log(v))