8000 GitHub - dok1qq/http-boilerplate: Small wrapper around fetch
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dok1qq/http-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Http boilerplate

Small wrapper around fetch. Often you don't need complex solutions to get data but need some abstraction for fetchApi in your code.

For using it just copy and paste to your project.

Example Get

const response = await http.get<Item>(url);
if (response.success) {
  // response.data
} else {
  // parseError(response);
}

Example Post

const response = await http.post<DataRequest, DataResponse>(url, body, { signal });
if (response.success) {
// response.data
} else {
// parseError(response);
}

About

Small wrapper around fetch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0