1.0.4 • Published 5 years ago

coffeekraken-ww-axios v1.0.4

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

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

  1. Install
  2. Get Started
  3. Requirements
  4. Available features
  5. Browsers support
  6. Contribute
  7. Who are Coffeekraken?
  8. 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

  1. All the query methods like request, get, delete, head, options, post, put, patch
  2. The axios.create method. It will return a promise filled with the actual axios instance
  3. All the axios.create query methods like request, get, delete, head, options, post, put, patch
  4. Setting some default configuration through the axios.defaults...

Unavailable features

  1. All the callbacks like paramsSerializer, adapter, onUploadProgress, onDownloadProgress, etc...
  2. interceptors
  3. Cancellation
  4. application/x-www-form-urlencoded format

Browsers support

IE / EdgeFirefoxChromeSafari
IE11+last 2 versionslast 2 versionslast 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:

  1. Share the love ❤️
  2. Declare issues
  3. Fix issues
  4. Add features
  5. Build web component

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...