const state = {
  operateFuns: {},
};

const mutations = {
  /**
   *
   * @param {Object} state
   * @param {Object} funs
   * @returns
   */
  ADD_OPERATE_FUN(state, funs) {
    const id = Symbol("transaction-id");
    state.operateFuns[id] = funs;
    return id;
  },
};

const actions = {
  setOperateFuns({ commit }, funs) {
    commit("ADD_OPERATE_FUN", funs);
  },
};

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