mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +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 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) {
|
||||
return new Axios(defaultConfig);
|
||||
};
|
||||
|
||||
// Expose defaults
|
||||
axios.defaults = defaultInstance.defaults;
|
||||
|
||||
// Expose all/spread
|
||||
axios.all = function all(promises) {
|
||||
return Promise.all(promises);
|
||||
};
|
||||
axios.spread = require('./helpers/spread');
|
||||
|
||||
// Expose interceptors
|
||||
axios.interceptors = defaultInstance.interceptors;
|
||||
|
||||
// Provide aliases for supported request methods
|
||||
utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {
|
||||
/*eslint func-names:0*/
|
||||
|
||||
Reference in New Issue
Block a user