My current struggle lies within this particular example:
const r1 = new ReplaySubject(2);
const r2 = new ReplaySubject(2);
r1.next('r1.1');
r1.next('r1.2');
r2.next('r2.1');
combineLatest([r1, r2]).subscribe(console.log); // -> ["r1.2", "r2.1"]
combineLatest([r2, r1]).subscribe(console.log); // -> ["r2.1", "r1.1"] -> ["r2.1", "r1.2"]
// r1.1 ----> r1.2 --------
// -------------------> r2.1
After much contemplation, I find that my understanding may be hindered by the application's execution rather than the function's given specifications to produce the latest combinations.
Nevertheless, my quest is for a functionality similar to "combineEvery
" that consistently outputs the second value. How might I go about implementing this?
// r1.1 ----> r1.2
// -------------------> r2.1
// -------------------------------> r3.1
[r1.1, r2.1, r3.1] -> [r1.2, r2.1, r3.1]