import { Observable , from } from "rxjs" ; import { switchMap } from "rxjs/operators" ; param promise param observableFn export default function mapPromiseToObservale < TPromiseValue , TObservableValue > ( promise , observableFn ) { return from ( promise ) . pipe ( switchMap ( observableFn ) ) ; } ;