Closed Kahss closed 3 years ago
Hey @D-Maurel
Could you provide a version of vuex/vue library you are using? Accessing this
inside the module is not documented so it might be removed (or have already been removed)
I suggest checking approach (1) described here https://github.com/probil/vue-socket.io-extended/issues/91#issuecomment-397232621 as it will also work in any other places (not just outside vuex)
Hey @probil
Here is the return of npm list
├── vue-socket.io-extended@5.0.0-alpha.3
├── vue@3.0.7
└── vuex@4.0.0
If you have any new approach, I'm interested. In the meantime, i'll try the solutions you've linked, thank you !
EDIT : I've tried putting the socket definition in a separate file, but it works, thank you !
Oh, I assume it's probably because of vuex 4 & vue 3. It doesn't use classes under the hood anymore. 🤔
@D-Maurel let's close the issue if the solution works for you
Hi,
I can't find a way to make an emit from inside a socket action work. Here is my code
This code is located is a vuex module. When I reach the
emit
line, vue devtools tells me thatthis._vm is undefined
. Any idea ?