Skip to content Skip to sidebar Skip to footer

Rxjs: How Can I Do An "if" With Observables?

Say I have two observables and one I want to listen on changes in one observable, if the other on matches a certain condition. I tried it with zip but it seems I will only be notif

Solution 1:

Use pausable:

secondState
    .pausable(firstState.map(function (s) { return s !== undefined; }))
    .subscribe(function (second) {
        // only occurs when first is truthy
    });

Post a Comment for "Rxjs: How Can I Do An "if" With Observables?"