title: Nuxt: Vuex commit or dispatch message outside vuejs component
body: <p>I have an application in nuxt that I want to connect to a websocket, I have seen examples where the callback to receive messages is placed inside a component, but I do not think ideal, I would like to place the callback inside my store, currently my code is something like this</p>
  
  <pre><code>//I'm using phoenix websocket
  var ROOT_SOCKET = `wss://${URL}/socket`;
  
  var  socket = new Socket(ROOT_SOCKET);
  socket.connect()
  var chan = socket.channel(`connect:${guid}`); 
  
  chan.join();
  console.log("esperando mensj");
  
  chan.on("translate", payload =&gt; {
    console.log(JSON.stringify(payload));
    &lt;store&gt;.commit("loadTranslation",payload) //&lt;- how can I access to my store?
  })
  
  chan.onError(err =&gt; console.log(`ERROR connecting!!! ${err}`));
  
  
  const createStore = () =&gt; {
    return new Vuex.Store({
     state: {},
  
     mutations:{
      loadTranslation(state,payload){...}
     },
  
  
  ....
  })}
  </code></pre>
  
  <p>how can I access to my store inside my own store file and make a commit??? is it possible?...
  I know there is a vuex plugin but I can't really understand well the documentation and I'll prefer build this without that plugin
  <a href="https://vuex.vuejs.org/guide/plugins.html" rel="nofollow noreferrer">https://vuex.vuejs.org/guide/plugins.html</a></p>
  
  <p>thank you guys...hope you can help me...</p>