{"size": 706, "ext": "js", "max_stars_repo_path": "src/store/index.js", "max_stars_repo_name": "dharmendrasehgal/google-news-vue", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/store/index.js", "max_issues_repo_name": "dharmendrasehgal/google-news-vue", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/store/index.js", "max_forks_repo_name": "dharmendrasehgal/google-news-vue", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.1025641026, "max_line_length": 47, "alphanum_fraction": 0.545325779}
import Vue from "vue";
import Vuex from "vuex";
import axios from "axios";
import API from "../assets/data";

Vue.use(Vuex, axios);

export default new Vuex.Store({
  state: {
    news: [],
    techNews: [],
    articles: []
  },
  getters: {},
  mutations: {
    SET_NEWS(state, news) {
      state.news = news;
    },
    SET_TECH_NEWS(state, news) {
      state.techNews = news;
    },
    SET_ARTICLES(state, articles) {
      state.articles = articles;
    }
  },
  actions: {
    loadNews() {
      API("in", null, "SET_NEWS");
    },
    loadTechNews() {
      API("in", "technology", "SET_TECH_NEWS");
    },
    loadArticles() {
      API("us", null, "SET_ARTICLES");
    }
  },
  modules: {}
});
