Reputation: 6814
I am looking for a way to combine multiple Observables into a flat tuple of scalar values - similar to .combineLatest()
- but with the exception that it should emit a new value tuple even when no value has been emitted on one of the source observables - yieldung "undefined" in the tuple for those observables that did not yet emit.
Example:
const s1 = new Subject<string>();
const s2 = new Subject<string>();
Observable.combineWithUndefined(s1, s2).subscribe( ([t1, t2]) => {
console.log(t1.toString() + " " + t2.toString());
});
s1.next("Hello");
s2.next("John");
// expected output:
// Hello undefined
// Hello John
Upvotes: 1
Views: 202