import {equals, isEmpty} from 'ramda'

const initState = {
  modalMachines: [],
};

const state = {
  ...initState
};

const getters = {
  modalMachines: (state) => state.modalMachines,
};

const mutations = {
  setModalMachines: (state, updval) =>  state.modalMachines = updval,
  resetStore: (state) => {
    for (let key in initState) {
      state[key] = initState[key]
    }
  }
};


const actions = {
  saveModalMachines: ({commit}, machines) => {
    commit('setModalMachines', machines)
  },
  resetStore: ({commit}) => {
    commit('resetStore')
  }
};

export const store = {
  namespaced: true,
  state,
  getters,
  mutations,
  actions,
};
