DEV Community

Discussion on: TypeScript – Wrapping axios with an HttpClient class

Collapse
 
cristalt profile image
Marcelo Forclaz

Nice!
Just one doubt. Why don't you simply return the axios promise in each method instead putting it into a new Promise constructor?

Collapse
 
devseo profile image
DevSEO

To avoid coupling with axios. That is the purpose of the post.

Collapse
 
mehdicharife profile image
Mehdi Charife • Edited

I think he was talking about the implementation. The implementation is already coupled with axios. Can you explain why e.g. you didn't just return the promise returned by axios.get in your implementation of the get method?