{"size": 909, "ext": "js", "max_stars_repo_path": "src/module/index.js", "max_stars_repo_name": "dreipol/vue-route-fetch", "max_stars_repo_stars_event_min_datetime": "2018-02-01T18:03:28.000Z", "max_stars_repo_stars_event_max_datetime": "2020-08-03T06:05:15.000Z", "max_issues_repo_path": "src/module/index.js", "max_issues_repo_name": "dreipol/vue-route-fetch", "max_issues_repo_issues_event_min_datetime": "2017-12-08T13:08:47.000Z", "max_issues_repo_issues_event_max_datetime": "2018-07-05T16:34:08.000Z", "max_forks_repo_path": "src/module/index.js", "max_forks_repo_name": "dreipol/vue-route-fetch", "max_forks_repo_forks_event_min_datetime": "2018-01-12T16:08:50.000Z", "max_forks_repo_forks_event_max_datetime": "2019-11-11T21:29:51.000Z"}
{"max_stars_count": 6, "max_issues_count": 2, "max_forks_count": 4, "avg_line_length": 23.3076923077, "max_line_length": 61, "alphanum_fraction": 0.600660066}
import { GlobalVue } from '../index';

import * as types from './mutation-types';
import * as actions from './actions';

const mutations = Object.freeze({
    [types.SET_IS_INITIAL_ROUTE](state, { isInitialRoute }) {
        state.isInitialRoute = isInitialRoute;
    },
    [types.SET_ROUTE_DATA](state, { key, value }) {
        GlobalVue.set(state.routes, key, value);
    },
    [types.SET_PARTIALS_DATA](state, { key, value }) {
        GlobalVue.set(state.partials, key, value);
    },
    [types.SET_LOADING_STATE](state, { isLoading }) {
        state.isLoading = isLoading;
    },
    [types.FLUSH_CACHE](state) {
        GlobalVue.set(state, 'routes', {});
        GlobalVue.set(state, 'partials', {});
    },
});

const state = {
    isInitialRoute: true,
    isLoading: false,
    routes: {},
    partials: {},
};


export default {
    namespaced: true,
    mutations,
    actions,
    state,
};
