Wrap an API function in an RxJs Observable
I am a newbie to RxJs and I have an API that I am using for geocoding that provides a function like the following: simpleGeocode(options) * where options = { address: {addr: ... }, success: Function, failure: Function}. The success function returns the geocoded LatLon object. I am using this in Angular app with NGRX Effects and so I would like it to have it as an Observable so I can use the standard Effect setup like: @Effect() public calculateLocation: Observable<void> = this.actions .ofType(actions.CALCULATE_LOCATION) .switchMap((action) => { let location = action.payload; let options = {