const SET_PAGES = 'SET_PAGES';
const state = {
  loaded: false,
  data: undefined,
};

const getters = {
  pages(state) {
    return state.data
  }
};

const actions = {
  setPage({ commit }, pages) {
    console.log("setPage", pages);
    commit( SET_PAGES, pages );
  }
};

const mutations = {
  [SET_PAGES](state, payload) {
    console.log("SET_PAGES", payload);
    state.loaded = true;
    state.data = payload;
  }
};

export default {
  state,
  getters,
  actions,
  mutations,
}
