async-fetch-client

1.0.9 • Public • Published

Async Fetch Client

Simple wrapper around isomorphic-fetch to help make API calls easier. This is a function I end up reusing in different projects, mostly tailored to my own use.

Install

npm install --save async-fetch-client

Usage

import fetchClient from 'async-fetch-client';

const { error, json } = await fetchClient('/api/users', { method: 'GET' });
if (error) {
  // handle error
}

// continue to use `json` however you want.

Readme

Keywords

none

Package Sidebar

Install

npm i async-fetch-client

Weekly Downloads

0

Version

1.0.9

License

MIT

Unpacked Size

6.31 kB

Total Files

4

Last publish

Collaborators

  • arjanj