Q:

RxJS combine streams and use value of both to call a third

I've got an Angular 2 application where I have an 'AlgemeneInfoService' with a getAlgemeneInfo() method that returns an Observable.
Using angular-redux/store, I've got a store that has a 'Dossier' and 'Verpleegperiode' object in it, both having an Id that the AlgemeneInfoService uses to get the 'AlgemeneInfo' object. (the VerpleegperiodeId can be null)
I'm trying to put the ActiveAlgemeneInfo, which should be refreshed by calling the AlgemeneInfoService when the state-object of either Dossier or Verpleegperiode changes, in the state-object.
My plan was using an ActiveAlgemeneInfoService that handles these subscriptions and has a method getActiveAlgemeneInfo() which returns the 'selectedAlgemeneInfo' that is set with a subscription to the ActiveAlgemeneInfo state object:
@select(state => state.dieet.activeAlgemeneInfo) 
private activeAlgemeneInfo$: Observable<AlgemeneInfo>;

In the constructor of the service, I set the subscriptions:
Observable.combineLatest(
  this.activeInfohosVerpleegperiode$,
  this.activeInfohosDossier$
)
.distinctUntilChanged()
.subscribe(([v, d]) => {
  const verpleegperiodeId = v != null ? v.verpleegperiodeId : null;
  const dossierId = d.dossierId;
  console.log(`vp id: ${verpleegperiodeId} - d id: ${dossierId}`);
  this._setActiveAlgemeneInfo(dossierId, verpleegperiodeId);
});

this.activeAlgemeneInfo$.subscribe(algemeneInfo => this.selectedAlgemeneInfo = algemeneInfo);

And in the service, I've also got a method:
private _setActiveAlgemeneInfo = (dossierId: number, verpleegperiodeId: number) => {
this._algemeneInfoService
  .getAlgemeneInfo(dossierId, verpleegperiodeId)
  .subscribe(algemeneInfo => this._dieetActions.selectAlgemeneInfo(algemeneInfo));
}

When the service is constructed and the method getActiveAlgemeneInfo() is called:
public getActiveAlgemeneInfo = (): Observable<AlgemeneInfo> => {
     return this.activeAlgemeneInfo$;
}

it just spams http requests, while when I console.log the Observable.combineLatest(), the Dossier and Verpleegperiode are exactly the same as the previous request.
How can I get this to work?

A:

You should move the distinctUntilChanged - because it does not do a "deep" comparison, it only compares the reference - and for combineLatest this will always be a new array.
Try the following and see if that helps with your issue:
Observable.combineLatest(
  this.activeInfohosVerpleegperiode$.distinctUntilChanged(),
  this.activeInfohosDossier$.distinctUntilChanged()
)
.subscribe(([v, d]) => {

Alternatively you should provide a compare-method that does perform a deep-comparison like so:
Observable.combineLatest(
  this.activeInfohosVerpleegperiode$,
  this.activeInfohosDossier$
)
.distinctUntilChanged(_.isEqual) // from: https://lodash.com/docs/#isEqual
.subscribe(([v, d]) => {

