The Angular 4.3 update introduces the new HttpClient class, which appears to return Object instead of any as the default type.
Is there a specific reason for this decision, especially considering the TypeScript documentation advises against using types like Number, String, Boolean, or Object?
Don’t ever use the types Number, String, Boolean, or Object. These types refer to non-primitive boxed objects that are almost never used appropriately in JavaScript code.
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html
While I understand that I can specify my own return type using:
this.httpService.get<any>('/api1').subscribe(Data => {console.log(Data.Value1)});
It would seem more convenient to have any as the default. I know I can define a specific type for the data being returned, but using any would make it more versatile.
I was considering extending the HttpClient class and overriding the methods to return any, but wanted to check if there was something important I might have overlooked.