Created
October 27, 2017 15:35
-
-
Save mfp22/be6f34dacf66c06eca4daa32039e914e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public muteFirst = <T,R>(first$: Observable<T>, second$: Observable<R>) => Observable.combineLatest( | |
first$, | |
second$, | |
(a,b) => b | |
).distinctUntilChanged(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have something that is triggered by
second$
changing, thatdistinctUntilChanged
can be vital. Else, that event will be triggered whenfirst$
emits also.If you don't want
distinctUntilChanged
onb
but also don't want updates whena
changes, I think this is an alternative: