const FETCH_START = 'FETCH_START';
const FETCH_DONE = 'FETCH_DONE';

const state = () => ({
  loading: true,
});

const getters = {
  loading: state => state.loading,
};

const actions = {
  fetchStart({ commit }) {
    commit(FETCH_START);
  },
  fetchDone({ commit }) {
    commit(FETCH_DONE);
  },
};
const mutations = {
  [FETCH_START](state) {
    state.loading = true;
  },
  [FETCH_DONE](state) {
    state.loading = false;
  },
};
export default {
  state,
  getters,
  actions,
  mutations,
};
