coffeekraken-ww-axios v1.0.4
Coffeekraken ww-axios
Expose axios through a web worker. Not all the axios features are available due to limitation in the service worker postMessage api.
Table of content
- Install
- Get Started
- Requirements
- Available features
- Browsers support
- Contribute
- Who are Coffeekraken?
- Licence
Install
npm install coffeekraken-ww-axios --save
Get Started
import axios from 'coffeekraken-ww-axios'
axios.get('...', {
// options
}).then((response) => {
// do something with the response
})
Requirements
In order to work, you need to install the webpack worker-loader with the config as bellow:
// ...
rules: [
// ...
{
test: /\.worker\.js$/,
use: {
loader: 'worker-loader',
options: {
inline: true,
fallback: false
}
},
}
]
Available features
- All the query methods like
request, get, delete, head, options, post, put, patch
- The
axios.create
method. It will return a promise filled with the actual axios instance - All the
axios.create
query methods likerequest, get, delete, head, options, post, put, patch
- Setting some default configuration through the
axios.defaults...
Unavailable features
- All the callbacks like
paramsSerializer
,adapter
,onUploadProgress
,onDownloadProgress
, etc... - interceptors
- Cancellation
- application/x-www-form-urlencoded format
Browsers support
IE / Edge | Firefox | Chrome | Safari |
---|---|---|---|
IE11+ | last 2 versions | last 2 versions | last 2 versions |
As browsers are automatically updated, we will keep as reference the last two versions of each but this component can work on older ones as well.
Contribute
This is an open source project and will ever be! You are more that welcomed to contribute to his development and make it more awesome every day. To do so, you have several possibilities:
Who are Coffeekraken
We try to be some cool guys that build some cool tools to make our (and yours hopefully) every day life better.
More on who we are
License
The code is available under the MIT license. This mean that you can use, modify, or do whatever you want with it. This mean also that it is shipped to you for free, so don't be a hater and if you find some issues, etc... feel free to contribute instead of sharing your frustrations on social networks like an asshole...