import { Module } from 'vuex';
// 此处加上 `.ts` 后缀报错，具体原因不详

const socketMessage: Module = {
	namespaced: true,
	state: {
		websocketMessages: ""
	},
	mutations: {
		ADD_WEBSOCKET_MESSAGE(state, message) {
    state.websocketMessages = message;
    },
    CLEAR_WEBSOCKET_MESSAGES(state) {
      state.websocketMessages = "";
    }
	},
  actions: {},
  getters: {
    getWebSocketMessages: (state) => state.websocketMessages
  }
};

export default socketMessage;
