{"size": 364, "ext": "js", "max_stars_repo_path": "generator/vuex-api-request/template/src/vendor/vuex-api-request/watch.js", "max_stars_repo_name": "Frontend-Paradise-Soft/vue-cli-plugin-paradise-soft-starter-template", "max_stars_repo_stars_event_min_datetime": "2019-01-21T12:51:41.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-12T09:46:15.000Z", "max_issues_repo_path": "generator/vuex-api-request/template/src/vendor/vuex-api-request/watch.js", "max_issues_repo_name": "Frontend-Paradise-Soft/vue-cli-plugin-paradise-soft-starter-template", "max_issues_repo_issues_event_min_datetime": "2019-01-29T03:10:50.000Z", "max_issues_repo_issues_event_max_datetime": "2019-01-29T03:12:17.000Z", "max_forks_repo_path": "generator/vuex-api-request/template/src/vendor/vuex-api-request/watch.js", "max_forks_repo_name": "Frontend-Paradise-Soft/vue-cli-plugin-paradise-soft-starter-template", "max_forks_repo_forks_event_min_datetime": "2019-01-29T03:02:48.000Z", "max_forks_repo_forks_event_max_datetime": "2019-01-29T03:02:48.000Z"}
{"max_stars_count": 9, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 26.0, "max_line_length": 91, "alphanum_fraction": 0.6593406593}

import createWatch from 'vuex-api-request/lib/createWatch';

const watch = createWatch({
  vuexApiModuleName: 'api',
  response: (res) => res,
  error: (err) => err && err.response && err.response.data,
  errorHandler: (context, err) => {
    if (err.response.status === 401) context.dispatch('auth/logout', null, { root: true });
  },
});

export default watch;
