0.2.0 • Published 9 years ago

asyncawait-fetch v0.2.0

Weekly downloads
1
License
MIT
Repository
-
Last release
9 years ago

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

0.2.0

9 years ago

0.1.0

9 years ago