I'm building an Angular2 app, so I'm getting used to Observables and Reactive Extensions as a whole. I'm using TypeScript and rxjs.
Now I've got an observable, or a stream if you will, of an array of some objects. Let's say Person-objects. Now I've got two other streams of Person-objects and want to combine these so I get a stream which is always up to date:
var people$ = getPeople(); // Observable<Person[]>
var personAdded$ = eventHub.personAdded; // Observable<Person>;
var personRemoved$ = eventHub.personRemoved // Observable<Person>;
var allwaysUpToDatePeople$ = people$.doSomeMagic(personAdded$, personRemoved$, ...);
If the people-stream emits an array of, let's say, 5 people, and after that the personAdded-stream emits a person, the allPeople-stream wil emit an array of 6. If the personRemoved-stream emits a person, the allPeople-stream should emit an array of Person-objects without the one just emitted by the personRemoved-stream.
Is there a way built into rxjs to get this behaviour?