async-fetch-client
v1.0.9
Published
Thin wrapper around isomorphic-fetch to make API calls easier, for client or server.
Readme
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-clientUsage
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.