DEV Community

Discussion on: My Fetch Wrapper with async/await and TypeScript

Collapse
 
tomekbuszewski profile image
Tomek Buszewski

Hey, very nice! A few remarks:

  • this function has a lot of arguments, perhaps try to use an object merged with default values;
  • method should be an enum, otherwise typos are welcome (path instead of patch for example);
  • it would be nice if you'd provide a structured response with status code – sometimes it makes a difference;
  • body shouldn't be allowed on get requests.

There are very minor things, no deal-breakers. Great job!

Collapse
 
avxkim profile image
Alexander Kim • Edited

Thank you for your tips, definitely need to improve this.