Can you help me determine the correct method signature for handleError
?
The linter tslint
is indicating an error message that says
expected call-signature: 'handleError' to have a typedef (typedef)
.
Here is the code snippet in question:
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable, of } from 'rxjs';
private handleError<T>(result?: T) {
return (error: any): Observable<T> => {
console.error(error);
return of(result as T);
};
}
I originally thought it was returning Observable<T>
, but that appears to be incorrect. Then I considered if it might be a method that returns
(error: any): Observable<T>
, yet that also does not seem to be the answer.