0

i'm try to use pipe in rxjs with map

my code is below down.

Service.js
import { map, catchError } from 'rxjs/operators';
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';

getFunction(){
    return this.http.get(someurl, { params: parameter })
    .pipe(map(this.extractData), cathError(catchFunction));
}

extractData(res: HttpResponse<any>){

   console.log(this) <<<<< here is problem. this value always `MapSubscriber` type.
}

the problem is extractData function in this.

if i didnt set second parameter (aka thisArg) this value must be set undefined.

but, thisArg always set MapSubscriber type even i didnt insert second parameter in map function.

in reference https://rxjs-dev.firebaseapp.com/api/operators/map

could you please help me? why this call set MapSubscriber typs?

naiad
  • 157
  • 1
  • 12

0 Answers0