I recently came across the Angular tutorial here
In the code snippet below, there are double type declarations that I am having trouble understanding.
handleError<T>(operation = 'operation', result?: T) {
return (error: any): Observable<T> => {
console.error(error);
this.log(`${operation} failed: ${error.message}`);
return of(result as T);
};
}
The error is defined as type any, followed by another colon which declares a function with Observable as the parameter. What exactly does it return?