license import { ObservableInput , pipe , combineLatest , ObservedValueOf , OperatorFunction , } from 'rxjs' ; import { map , switchMap , take } from 'rxjs/operators' ; function switchLatestFrom < T , O1 extends ObservableInput < any > > ( obs1 ) ; function switchLatestFrom < T , O1 extends ObservableInput < any > , O2 extends ObservableInput < any > > ( obs1 , obs2 ) ; function switchLatestFrom < T > ( ... observables ) { return pipe ( switchMap ( ( v ) => combineLatest ( observables ) . pipe ( take ( 1 ) , map ( ( obs ) => [ v ] . concat ( obs ) ) ) ) ) ; } export default switchLatestFrom ;