mirror of
https://github.com/tenrok/axios.git
synced 2026-06-17 19:21:29 +03:00
Bit of code cleanup
This commit is contained in:
+5
-6
@@ -79,22 +79,21 @@ Axios.prototype.request = function request(config) {
|
|||||||
var defaultInstance = new Axios(defaults);
|
var defaultInstance = new Axios(defaults);
|
||||||
var axios = module.exports = bind(Axios.prototype.request, defaultInstance);
|
var axios = module.exports = bind(Axios.prototype.request, defaultInstance);
|
||||||
|
|
||||||
|
// Expose properties from defaultInstance
|
||||||
|
axios.defaults = defaultInstance.defaults;
|
||||||
|
axios.interceptors = defaultInstance.interceptors;
|
||||||
|
|
||||||
|
// Factory for creating new instances
|
||||||
axios.create = function create(defaultConfig) {
|
axios.create = function create(defaultConfig) {
|
||||||
return new Axios(defaultConfig);
|
return new Axios(defaultConfig);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Expose defaults
|
|
||||||
axios.defaults = defaultInstance.defaults;
|
|
||||||
|
|
||||||
// Expose all/spread
|
// Expose all/spread
|
||||||
axios.all = function all(promises) {
|
axios.all = function all(promises) {
|
||||||
return Promise.all(promises);
|
return Promise.all(promises);
|
||||||
};
|
};
|
||||||
axios.spread = require('./helpers/spread');
|
axios.spread = require('./helpers/spread');
|
||||||
|
|
||||||
// Expose interceptors
|
|
||||||
axios.interceptors = defaultInstance.interceptors;
|
|
||||||
|
|
||||||
// Provide aliases for supported request methods
|
// Provide aliases for supported request methods
|
||||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
||||||
/*eslint func-names:0*/
|
/*eslint func-names:0*/
|
||||||
|
|||||||
Reference in New Issue
Block a user