From 70ef49eeb93b7cdc0e3579a263268ffd64cfa108 Mon Sep 17 00:00:00 2001 From: Matt Zabriskie Date: Sun, 24 Jan 2016 15:27:30 -0700 Subject: [PATCH] Bit of code cleanup --- lib/axios.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/axios.js b/lib/axios.js index 1a32b75..d714966 100644 --- a/lib/axios.js +++ b/lib/axios.js @@ -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*/