Gasket will utilize the Fetch API as our standard request library. This package serves as a proxy for fetch implementations with server-side support.
npm i @gasket/fetch
import fetch from '@gasket/fetch';
fetch('url/to/resource')
.then(res => {
if (res.ok) {
// handle success
} else {
// handle error
}
});
import fetch from '@gasket/fetch';
const getSomething = async () => {
const res = await fetch('url/to/resource');
if (res.ok) {
// handle success
} else {
// handle error
}
};