Last active
April 25, 2019 09:26
-
-
Save oops-wrong/a9ba9a0382b8c271a52f08b4c5af155b to your computer and use it in GitHub Desktop.
Subscription to both observables but data gets from the second only (spec file https://gist.github.com/oops-wrong/db1b3b481b471cd2117b052d7e171eb5)
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
export const muteFirst = <T, R>(first$: Observable<T>, second$: Observable<R>): Observable<R> => { | |
return combineLatest(first$, second$).pipe( | |
map(([a, b]: [T, R]): R => b), | |
distinctUntilChanged(), | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment