1.0.12 • Published 6 years ago

ywl-fetch v1.0.12

Weekly downloads
53
License
-
Repository
-
Last release
6 years ago

fetch-polyfill

<<<<<<< HEAD a fetch polyfill(es6 style)

Installation

  • npm install ywl-fetch --save;

Usage

in this way, your need use babel to compile,.babelrc file like

{
  "presets": [
    [
      "env"
    ],
    "stage-2"
  ],
  "plugins": [
    "transform-runtime"
  ]
}
import {fetch,Response,Request} from 'ywl-fetch'
fetch('./mock/a.json')
        .then(function (response) {
                return response.json()
        }).then(json => {
                console.info(json)
      })

Script

  <script src="./dist/fetch-polyfill.js"></script>
  <script>
  fetch('./mock/a.json')
            .then(function (response) {
                    return response.json()
            }).then(json => {
                    console.info(json)
          })
</script>

Support

ie10+ or chrome etc.

======= a fetch polyfill,support interceptors

parent of 40b0a91... Update README.md

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago