A fetch wrapper is a piece of code that wraps the JavaScript fetch() function, which is used to make HTTP requests. It typically provides a simpler, more convenient interface for making common types of requests, such as GET, PUT, POST, and DELETE.
Here is an example of a fetch wrapper that provides these four methods:
In this example, the FetchWrapper class has a constructor that takes a base URL as an argument. It then provides four methods for making GET, PUT, POST, and DELETE requests using the fetch() function. Each method returns a Promise that resolves with the JSON response from the server.