Welcome to mirror list, hosted at ThFree Co, Russian Federation.

vue_resource_interceptor.js.es6 « environments « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 406bdbc1c7d5e3c3196fa76db545f057e4de0319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
/* global Vue */
Vue.http.interceptors.push((request, next) => {
  Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;

  next((response) => {
    if (typeof response.data === 'string') {
      response.data = JSON.parse(response.data); // eslint-disable-line
    }

    Vue.activeResources--; // eslint-disable-line
  });
});