Instantly share code, notes, and snippets.
muteFirst is a helper that joins two levels of dependency together: From the server to the store via first$, and from the store to the component via second$.
If you have something that is triggered by second$ changing, that distinctUntilChanged can be vital. Else, that event will be triggered when first$ emits also.
If you don't want distinctUntilChanged on b but also don't want updates when a changes, I think this is an alternative:
public muteFirst = <T,R>(first$: Observable<T>, second$: Observable<R>) => second$.withLatestFrom(
(b, a) => b