2.0.1-0 • Published 5 years ago

axios-sugar v2.0.1-0

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

Travis (.org) Coveralls github version download license

Locales

简体中文

AxiosSugar

An wrapper for axios.js

Carefully

The new version has significant changes and is not compatible with the old version.
Compared with the old version, it is used in a very similar way to Axios.

Features

  • Axios-Like Methods
  • Cancel Repeated Requests
  • Retry
  • Response Storage
  • Broken Network Retransmission
  • Handlers for Http-Status-Code Responses
  • Cancel All Requests Matched By Filter

Usage

import AxiosSugar from 'axios-sugar';

// suppose the request returns paramA
AxiosSugar.get('/somePath', {
  params: {
    paramA: 1
  }
}).then(res => {
  console.log(res.data); // 1
})

Look, it's really like Axios!The request, get, post, delete, put, patch, head, options is also.

The difference is that these methods also receive an AxiosSugarConfig type parameter. e.g.

AxiosSugar.get('/somePath', {
  params: {
    paramA: 1
  }
}, {
  retry: {
    enable: true
  }
})

Next, you should get more details in references

Test

Node test:

npm test

Some browser test(e.g. AxiosSugarLocalStorage):
open the corresponding index.html File in /test which built by mocha.

2.0.1-0

5 years ago

2.0.0-0

5 years ago

1.2.0

5 years ago

1.1.2-0

5 years ago

1.1.1-0

5 years ago

1.1.0-0

5 years ago

1.0.0

5 years ago