Let's say I have two observables and one, I want to listen to changes in one observable, if the other meets a certain condition. I tried it with zip , but it seems that they will notify me only if both observables change, but I want to receive notifications for every change in the observable, if the condition of the other is true.
What I tried:
var firstState = new Rx.BehaviorSubject(undefined); var secondState = new Rx.BehaviorSubject(undefined); Rx.Observable.zip(firstState, secondState, function (first, second) { return { first: first, second: second } }).filter(function (value) { return value.first !== undefined; }).subscribe(function (value) {
I noticed that there is Rx.Observable.if , but I could not get it to work.
source share