asyncawait-fetch
async/await wrapper around GitHub's Fetch polyfill.
Dependencies
Usage
asyncawait-fetch can be used as a drop in replacement for fetch by importing the library as a named alias import, i.e.
import { asyncawaitFetch as fetch } from 'asyncawait-fetch'
async function basicExample () {
return await fetch(`/users.json`)
}
async function optionsExample () {
return await fetch(`/users`, {
method: `post`,
body: new FormData(form)
})
}
async function overrideExample () {
return await fetch(`/users.html`, null, `json`)
}
License
Released under the MIT license: opensource.org/licenses/MIT