The 0.6.0
release contains mostly bug fixes, but there are a couple things to be aware of when upgrading.
Up until the 0.6.0
release ES6 Promise
was being polyfilled using es6-promise. With this release, the polyfill has been removed, and you will need to supply it yourself if your environment needs it.
require('es6-promise').polyfill();
var axios = require('axios');
This will polyfill the global environment, and only needs to be done once.
The success
, and error
aliases were deprectated in 0.4.0. As of this release they have been removed entirely. Instead please use axios.then
, and axios.catch
respectively.
axios.get('some/url')
.then(function (res) {
/* ... */
})
.catch(function (err) {
/* ... */
});
Previous versions of axios shipped with an AMD, CommonJS, and Global build. This has all been rolled into a single UMD build.
// AMD
require(['bower_components/axios/dist/axios'], function (axios) {
/* ... */
});
// CommonJS
var axios = require('axios/dist/axios');