title: Axios to return value from interceptor without actually making call
body: <p>I want to check for value in my Axios interceptor for a value in the params. If it matches a condition, don't make the call, but return an empty array.</p>
  <p>Here is my entire Axios config:</p>
  <pre><code>
  import Axios from 'axios'
  import store from '@/store'
  
  const AxiosConfig = Axios.create({
      baseURL: process.env.VUE_APP_BASE_API_URL
  })
  
  const addToken = (config) =&gt; {
      const token = store.getters['AuthModule/getAuthToken']
      if (token) {
          config.headers.Authorization = `Bearer ${token}`
      }
  }
  
  let numOfRequests = 0
  
  AxiosConfig.interceptors.request.use(
      (config) =&gt; {
          addToken(config)
          if (config.params.autocomplete.length &lt; 2){
            // don't make the call and return an empty [] like I did make the call.
          } 
          store.commit('SET_LOADER_TO_STATE', true)
          numOfRequests++
          return config
      },
      (error) =&gt; {
          store.commit('SET_LOADER_TO_STATE', false)
          numOfRequests--
          return Promise.reject(error)
      }
  )
  
  AxiosConfig.interceptors.response.use(
      (response) =&gt; {
          numOfRequests--
          if (numOfRequests === 0) {
              store.commit('SET_LOADER_TO_STATE', false)
          }
          return response
      },
      (error) =&gt; {
          store.commit('SET_LOADER_TO_STATE', false)
          numOfRequests--
          if (numOfRequests === 0) {
              store.commit('SET_LOADER_TO_STATE', false)
          }
          if (
              error.response.status === 401 &amp;&amp;
              error?.response?.data?.error?.message === 'Unauthenticated.'
          ) {
              store.dispatch('AuthModule/logoutUser')
              return
          }
          if (error?.response?.data?.error) {
              throw new Error(
                  error?.response?.data?.error.message ||
                      error.response.data.error ||
                      error.response.data
              )
          } else if (error?.response?.data?.errors) {
              const errors = {}
              const errorsList = error?.response?.data?.errors
  
              for (const key in errorsList) {
                  if (Object.prototype.hasOwnProperty.call(errorsList, key)) {
                      errors[key] = errorsList[key][0]
                  }
              }
  
              throw new Error(JSON.stringify(errors))
          } else if (error) {
              throw new Error(error.response.data.message)
          } else {
              throw new Error('Network Error')
          }
      }
  )
  
  export default AxiosConfig
  </code></pre>
  <p>Is this possible?</p>