@gasket/fetch
TypeScript icon, indicating that this package has built-in type declarations

7.0.0-next.4 • Public • Published

@gasket/fetch

Gasket will utilize the Fetch API as our standard request library. This package serves as a proxy for fetch implementations with server-side support.

Installation

npm i @gasket/fetch

Usage

Example with promises

import fetch from '@gasket/fetch';

fetch('url/to/resource')
  .then(res => {
    if (res.ok) {
      // handle success
    } else {
      // handle error
    }
  });

Example with async/await

import fetch from '@gasket/fetch';

const getSomething = async () => {
  const res = await fetch('url/to/resource');
  if (res.ok) {
    // handle success
  } else {
    // handle error
  }
};

Reference

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i @gasket/fetch

Weekly Downloads

71

Version

7.0.0-next.4

License

MIT

Unpacked Size

4.64 kB

Total Files

6

Last publish

Collaborators

  • bbetts
  • rxmarbles
  • ecarlson-godaddy
  • jpina1-godaddy
  • mmason2
  • kinetifex
  • 3rdeden
  • kawikabader