0.3.5 • Published 2 years ago

@angelrs/axios-fetch-adapter v0.3.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

What

This is a fork of @vespaiach/axios-fetch-adapter with changes specific to a project I'm working on. Only difference is that it adds support for AbortController.signal to abort requests while keeping same api to axios' CancelToken

How to use

See test folder for example of usage

Installation and Usage

You can install the adapter directly from this repository URL or feel free to copy its source code to your project.

npm install axios
npm install @angelrs/axios-fetch-adapter

There are two ways to use it:

  1. Create a new instance of Axios and pass this adapter in configuration
const instance = axios.create({
  baseURL: 'https://some-domain.com/api/',
  timeout: 1000,
  adapter: fetchAdapter
  ....
});
  1. Pass this adapter in each of request
axios.request({
  url: '/user',
  method: 'get',
  adapter: fetchAdapter
  ...
})

Note

  • Since, this adapter relies on fetch API so it won't work in Node environment

Credits

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago